![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
, rbrowning1958 <RBrowning1958 (AT) gmail (DOT) com> wrote: |
|
Hello, I have problem with divs and I think it's to do with sizing. I have cut down my HTML to this to illustrate the point: .... If I change the page background color, I want it to change the color outside the container div - i.e. the area of the browser not being used by my container div, but have the container background all white. |
|
What happens though is the height of the container div does seem to include the navbar - I suppose beacuse it is floated left, and the container is only white up to the height of the container text - if the navbar is longer it takes on the page background color. If I explicitly set the height of the container that handles but I don't want to do that - I suppsoe I need this navBar aligned left within the container and have the container size to include the navBar. I'm sure I'mm missing somethign simple - any ideas anyone? |
#3
| |||
| |||
|
|
div style="clear: left;} |
#4
| |||
| |||
|
|
In article 0c7cf6bd-7bee-4069-b596-d0c67fb48... (AT) l6g2000prm (DOT) googlegroups.com , *rbrowning1958 <RBrowning1... (AT) gmail (DOT) com> wrote: Hello, I have *problem with divs and I think it's to do with sizing. I have cut down my HTML to this to illustrate the point: ... If I change the page background color, I want it to change the color outside the container div - i.e. the area of the browser not being used by my container div, but have the container background all white. Suppose the body bg is pink, your container *is* all white. You have little content in it. The float overflows "container". There are several things you can do to get the look you want. 1. Put in lots of content into mainContent1 2. Add {overflow: hidden} to #container. 3. Add a small amount of content in an element just before closing #container and clear the element. 4. Add an empty clearing div just before closing #container for example, <div style="clear: left;} What happens though is the height of the container div does seem to include the navbar - I suppose beacuse it is floated left, and the container is only white up to the height of the container text - if the navbar is longer it takes on the page background color. If I explicitly set the height of the container that handles but I don't want to do that - I suppsoe I need this navBar aligned left within the container and have the container size to include the navBar. I'm sure I'mm missing somethign simple - any ideas anyone? You are missing that parents do not grow their height to cover their floated children, in a sense, they are blind to such children because these are out of the normal flow. -- dorayme |
#5
| |||
| |||
|
|
On Dec 22, 4:50*pm, dorayme <doraymeRidT... (AT) optusnet (DOT) com.au> wrote: 3. Add a small amount of content in an element just before closing #container and clear the element. 4. Add an empty clearing div just before closing #container for example, <div style="clear: left;} I'm sure I'mm missing somethign simple - any ideas anyone? You are missing that parents do not grow their height to cover their floated children, in a sense, they are blind to such children because these are out of the normal flow. Hello, Thanks for replying. That's very clear. I actually fixed it in the end by putting a footer in with a clear:left style. Cheers Ray |
![]() |
| Thread Tools | |
| Display Modes | |
| |