[thelist] css question...

Jono ox4dboy at comcast.net
Thu Nov 4 15:13:51 CST 2004


Try setting a width on the containing div that your float is in, 
something like this:

<head>
<style type="text/css">
#outerDiv {
	width: 500px;
	background: red;
	}
#outerDiv .half {
	float: left;
	width: 50%;
	background: silver;
	}
</style>
</head>
<body>
<div id="outerDiv">
<div class="half">this is the float</div>
&nbsp;</div>
</body>
</html>


On Nov 4, 2004, at 3:10 PM, Travis wrote:

> Hi all,
>
> I have a problem:  I want to nest a div within a div like so...
>
> <div>
>
>  <div style="float:left; width:50%"></div>
>
> </div>
>
> This works great in firefox, etc, but in ie the nested div is assigned 
> 50%
> the width of the entire page - not 50% the width of the parent div.
> Interestingly, if I remove the float, it works fine.  Unfortuneately I 
> need
> the float.
>
> Does anyone know of a workaround for this?  (Or am I doing something 
> wrong?)
> Thanks!
>
> -travis



More information about the thelist mailing list