HTML/CSS Div placing

Posted by Andreas Carlbom on Stack Overflow See other posts from Stack Overflow or by Andreas Carlbom
Published on 2010-04-10T16:52:35Z Indexed on 2010/04/10 17:03 UTC
Read the original article Hit count: 296

Filed under:
|
|

Yo. There's a tendency in placing divs to follow each other vertically, but what i'm trying to accomplish right now is to is basically to place a number of divs (two) inside a parent div like so:

<div id='parent'><div id='onediv'></div> <div id='anotherone'></div> </div>

And i'd like to place 'anotherone' just to the right of 'onediv'. Sadly, float:right is pretty much ruining the layout with the divs popping out of their parent divs and whatnot. Any suggestions are welcome.

Edit: It might be worth noting that the parent div and 'anotherone' has no height elements at all, with 'onediv' planned to be thought as the "height support" div, allowing the contents of 'anotherone' to make the parent div larger at will.

© Stack Overflow or respective owner

Related posts about html

Related posts about css