I have a div container which is postioned relative, which i use for messages.
Inside the container, i have 2 divs of different widths are they are both positioned absolute so they sit side by side.
The problem is becuase I don't know how long the message is going to be, i haven't set a height on any div and it is squashing all the content on top of each other, and not have a div with it's content under each of the other divs
I was able to get this to work by floating the inner divs left but then i couldn't get my 30px margin between each of the out divs
Code CSS:div.message { margin: 0px 0px 30px 0px; border: 1px solid #ccc; position: relative; } div.tdLeft { width: 130px; left: 0; top:0; position:absolute; padding: 10px; } div.tdRight { width: 690px; left: 130px; top:0; position: absolute; padding: 10px; }
and the html for each div
Code HTML4Strict:<div class='message'>"; <div class='tdLeft'><p>Posts: </p></div> <div class='tdRight'><p></p></div>; </div>




and adding some text to see what is going on, it actually looks good in IE7. You have to add the padding to the widths, though, to get the absolute divs to position correctly (tdRight's left property should be 150px). The 1px border around div.message becomes basically a straight line since positioning the two inner div's absolute takes them out of the document flow. In IE7 the two divs grow down to show all of their content with no problems. What does the rest of you code look like? What browser are you using? Did you validate your code?


Bookmarks