I Hate CSS

Can anyone explain why this doesn't work?

<body>
 <div style="border:1px solid black;height:100px;">
  <div style="border:1px solid red;display:block">hello</div>
  <div style="border:1px solid blue;">world</div>
  <div style="border:1px solid green;position:relative;bottom:0px;">CSS sucks</div>
</div>
</body>

What you get is three boxes all squished at the top of the parent box.  What I want, is for the green box, to be positioned at the bottom of the parent box.

One thought on “I Hate CSS”

  1. I believe position:relative is your problem, you could try switching to absolute.

    Futhermore: the only way I've ever got that to work is to explicitly set the height of every element, use floating divs, and then specifying a margin-top on the last one to move it to the bottom. Especially if you want it to look the same in IE and FF.

    Good luck,
    -W

Leave a Reply

Your email address will not be published.