think tank forum

technology » css hatred

lucas's avatar
16 years ago
link
lucas
i ❤ demo
sometimes i hate css.

like on this page, i wish the div would take up the entire height of the window and make the border span all the way:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>title. yeah!</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <style type="text/css">
            #full {
                height: 100%;
                width: 600px;
                border-right: 1px solid black;
            }
        </style>
    </head>
    <body>
        <div id="full">
            <h1>the photo album</h1>
            <h2>about</h2>
            <p>this is a photo album coded in php, organized in mysql, and driven by aws s3.</p>
        </div>
    </body>
</html>
asemisldkfj's avatar
16 years ago
link
asemisldkfj
the law is no protection
can't you get rid of the padding by explicitly setting it to 0 or a negative number or something?
lucas's avatar
16 years ago
link
lucas
i ❤ demo
the padding isn't the issue. regardless of padding, the div isn't expanded to the full height of the window.
Carpetsmoker's avatar
16 years ago
link
Carpetsmoker
Martin
It works when you use position: absolute;
http://www.rwxrwxrwx.net/test.html

It's not perfect, but depending on the rest of the page it may work...
lucas's avatar
16 years ago
link
lucas
i ❤ demo
yeah! thanks a lot. and it is perfect if we do what asemi suggested:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>title. yeah!</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <style type="text/css">
            * {
                margin: 0;
                padding: 0;
            }

            #full {
                position: absolute;
                height: 100%;
                width: 600px;
                border-right: 1px solid black;
            }
        </style>
    </head>
    <body>
        <div id="full">
            <h1>the photo album</h1>
            <h2>about</h2>
            <p>this is a photo album coded in php, organized in mysql, and driven by aws s3.</p>
        </div>
    </body>
</html>
Carpetsmoker's avatar
16 years ago
link
Carpetsmoker
Martin
This is for your photoalbum stuff, yes?

Take another look at http://www.rwxrwxrwx.net/test.html

Note how the height is 100%, which is not tall enough for all images ... it's only as high as your browser window ...

Maybe you can fix it with some complicated selector ... and/or some JavaScript ... I don't know ... Or maybe you can just leave it as it is if you don't think it's a problem...
nestor's avatar
16 years ago
link
nestor
nestor
CS you have the best domain
bluet's avatar
16 years ago
link
bluet
or you can use min-height
bluet's avatar
16 years ago
r1, link
bluet
this post has been archived.
lucas's avatar
16 years ago
link
lucas
i ❤ demo
css is dumb
nny's avatar
16 years ago
link
nny
M̮͈̣̙̰̝̃̿̎̍ͬa͉̭̥͓ț̘ͯ̈́t̬̻͖̰̞͎ͤ̇ ̈̚J̹͎̿̾ȏ̞̫͈y̭̺ͭc̦̹̟̦̭̫͊̿ͩeͥ̌̾̓ͨ
bug it cascades!
lucas's avatar
16 years ago
link
lucas
i ❤ demo
huh?