Web Design Forum: lost white background on wrapper ? - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

lost white background on wrapper ?

#1 User is offline   kam2701 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 179
  • Joined: 19-June 08
  • Reputation: 0
  • Experience:Beginner
  • Area of Expertise:Designer

Posted 14 April 2009 - 03:23 PM

Hi im trying to tidy some code from my first ever web site.

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
0

#2 User is offline   gfxpixeldesigns 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 495
  • Joined: 29-October 07
  • Reputation: 1
  • Gender:Male
  • Location:United Kingdom, Mossley
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 14 April 2009 - 04:46 PM

Id try removing the height completely since its a wrapper it shouldnt need a height property it will adjust itself, i think :)
0

#3 User is offline   kam2701 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 179
  • Joined: 19-June 08
  • Reputation: 0
  • Experience:Beginner
  • Area of Expertise:Designer

Posted 14 April 2009 - 04:56 PM

View Postgfxpixeldesigns, on Apr 14 2009, 13:46, said:

Id try removing the height completely since its a wrapper it shouldnt need a height property it will adjust itself, i think :)



I gave that a try but same problem. Never had so much hassle with a wrapper :-(
0

#4 User is offline   Meow 

  • Advanced Member
  • PipPipPip
  • View gallery
  • Group: Members
  • Posts: 476
  • Joined: 06-April 09
  • Reputation: 12
  • Gender:Female
  • Location:Rugby
  • Experience:Intermediate
  • Area of Expertise:Designer

Posted 14 April 2009 - 05:29 PM

Try floating the wrapper div if you're floating content divs inside it.
0

#5 User is offline   kam2701 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 179
  • Joined: 19-June 08
  • Reputation: 0
  • Experience:Beginner
  • Area of Expertise:Designer

Posted 14 April 2009 - 05:35 PM

View Postcinnamondm, on Apr 14 2009, 14:29, said:

Try floating the wrapper div if you're floating content divs inside it.



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?
0

#6 User is offline   Meow 

  • Advanced Member
  • PipPipPip
  • View gallery
  • Group: Members
  • Posts: 476
  • Joined: 06-April 09
  • Reputation: 12
  • Gender:Female
  • Location:Rugby
  • Experience:Intermediate
  • Area of Expertise:Designer

Posted 14 April 2009 - 05:50 PM

Is it your outermost wrapper? You may need to add another outside that one that doesn't need to float or be styled, just so as you can set auto margins to centre it.

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>
0

#7 User is offline   mr p 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 325
  • Joined: 09-December 08
  • Reputation: 6
  • Gender:Male
  • Location:London
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 14 April 2009 - 05:53 PM

there's a trick using <br /> that should solve it.

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}
0

#8 User is offline   Meow 

  • Advanced Member
  • PipPipPip
  • View gallery
  • Group: Members
  • Posts: 476
  • Joined: 06-April 09
  • Reputation: 12
  • Gender:Female
  • Location:Rugby
  • Experience:Intermediate
  • Area of Expertise:Designer

Posted 14 April 2009 - 05:56 PM

View Postmr p, on Apr 14 2009, 18:53, said:

there's a trick using <br> that should solve it.

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.
0

#9 User is offline   mr p 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 325
  • Joined: 09-December 08
  • Reputation: 6
  • Gender:Male
  • Location:London
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 14 April 2009 - 06:09 PM

View Postcinnamondm, on Apr 14 2009, 18:56, said:

That's interesting. I'd tried using clearing divs to no avail, but not using a br with it.


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.
0

#10 User is offline   Meow 

  • Advanced Member
  • PipPipPip
  • View gallery
  • Group: Members
  • Posts: 476
  • Joined: 06-April 09
  • Reputation: 12
  • Gender:Female
  • Location:Rugby
  • Experience:Intermediate
  • Area of Expertise:Designer

Posted 14 April 2009 - 06:37 PM

View Postmr p, on Apr 14 2009, 19:09, said:

were the divs empty? maybe that's why they didn't work.

Yes and no! Tried them with the comment inside <!-- --> which I thought was a way of fooling it into thinking it wasn't empty. However, I suspect the br is more 'solid' content for it.
0

#11 User is offline   kam2701 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 179
  • Joined: 19-June 08
  • Reputation: 0
  • Experience:Beginner
  • Area of Expertise:Designer

Posted 14 April 2009 - 06:40 PM

View Postmr p, on Apr 14 2009, 14:53, said:

there's a trick using <br /> that should solve it.

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 :-)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users