Forum Moderators: not2easy

Message Too Old, No Replies

div not expanding

I'm sure is obvious

         

Red_Eye

8:29 am on Aug 4, 2006 (gmt 0)

10+ Year Member



I have a div container. in that container I have 2 more divs. I want the 2 divs inside to display next to each other. eg.

<div id="container">
<div id="left>
content1
</div>
<div id="right">
content1
</div>
</div>

div#container
{
border:1px solid black;
}
div#left
{
float:left;
}
div#right
{
float:left;
}

The problem I have is that in both IE6 and FF the content of div left and right spill over the contatiner div. I think is something to do with the fact I am using divs. Like I say I'm sure its obvious

SilverLining

9:20 am on Aug 4, 2006 (gmt 0)

10+ Year Member



Have you tried setting a width on your divs or at least your main div? If you want a liquid design it's better to use %. I have tested it in IE and FF and it seems to work perfectly. It depends on your content inside the div.

Red_Eye

10:33 am on Aug 4, 2006 (gmt 0)

10+ Year Member



SilverLining, thanks for that, I knew it would be simple. It is a fluid layout so I set the width of the container to 100% and it all worked.

SilverLining

10:57 am on Aug 4, 2006 (gmt 0)

10+ Year Member



Great, that was an easy Friday fix.