On 11/28/06, Scott Bicknell <[EMAIL PROTECTED]> wrote:
> I want to create a site with a sidebar div {width:200px; float:
> left;} rule and a content div that stretches to fill the
> remaining space and that centers the content within that
> remaining space.
>
> When I specify a percentage width for the content div it behaves
> as if the floated div is not there. When I remove the float rule
> from the sidebar div, the content div sits below, rather than to
> the right of the sidebar div.

Your content div knows nothing about the floated div because floating
removes an element from the flow.  So you have to tell your content
div to start after the floated div by giving it an explicit left
margin of >200px.  Percent won't work because that changes with the
window size.  Give it a left margin in px of 201 px or more and don't
float or otherwise position it and it will naturally expand to the
full width of your viewport while leaving room for the floated object.

Ed
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to