lost white background on wrapper ?
#1
Posted 14 April 2009 - 03:23 PM
Im trying to make the wrapper and content divs expand as need be so im declaring height: auto
Howerver it doesnt auto expnad and now ive lost its white background.
Im really not sure what the problem is.
Can you see what im doing wrong ?
http://www.efficient...t/services.html
#2
Posted 14 April 2009 - 04:46 PM
#4
Posted 14 April 2009 - 05:29 PM
#5
Posted 14 April 2009 - 05:35 PM
cinnamondm, on Apr 14 2009, 14:29, said:
Hi that worked . Thank you :-)
The only prob though is because ive floated it left itīs on the left hand side of the page. It should be in the middle.
I have left and right margins set to auto though?
#6
Posted 14 April 2009 - 05:50 PM
For example, mine is structured as (with a bit of artistic license paid to the labelling!)
<div wrapper-with-auto-margins>
<div header></div>
<wrapper-that-floats-to-show-the-correct-background->
<div left-content></div>
<div right-content></div>
</div>
<div footer></div>
</div>
#7
Posted 14 April 2009 - 05:53 PM
pop the margin: 0 auto; back on the wrapper and remove the float, then add <br class="clearMe" /> (class it how you like) at the bottom of your wrapper after the content.
style = br.clearMe {clear: both; height: 0}
#8
Posted 14 April 2009 - 05:56 PM
mr p, on Apr 14 2009, 18:53, said:
pop the margin: 0 auto; back on the wrapper and remove the float, then add <br class="clearMe"> (class it how you like) at the bottom of your wrapper after the content.
style = br.clearMe {clear: both; height: 0}
That's interesting. I'd tried using clearing divs to no avail, but not using a br with it.
#9
Posted 14 April 2009 - 06:09 PM
cinnamondm, on Apr 14 2009, 18:56, said:
were the divs empty? maybe that's why they didn't work.
using <br /> in this way after a load of floated content gives the wrapper a way of knowing where the content ends, i assume this is because <br /> is treated as content. not sure if empty divs are treated the same.
#11
Posted 14 April 2009 - 06:40 PM
mr p, on Apr 14 2009, 14:53, said:
pop the margin: 0 auto; back on the wrapper and remove the float, then add <br class="clearMe" /> (class it how you like) at the bottom of your wrapper after the content.
style = br.clearMe {clear: both; height: 0}
Yeah that worked. Dont have a clue why but it works :-)
- ← <p> and <body>..are they the same?
- CSS, XHTML/HTML & JavaScript
- Coding Help - Gaps, and Missing Background. →
Help

















