Floated Divs dont expand centered div in firefox

This is a discussion on "Floated Divs dont expand centered div in firefox" within the Web Page Design section. This forum, and the thread "Floated Divs dont expand centered div in firefox are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Dec 23rd, 2006, 20:44
Reputable Member
Join Date: May 2006
Location: Scotland
Age: 18
Posts: 229
Thanks: 0
Thanked 0 Times in 0 Posts
Floated Divs dont expand centered div in firefox

Okay basically I have a wrapper div which holds everything and centers it. It has borders left and right which are supposed to go all the way down the page. My problems is my main content is two floated divs inside a main div. These floated divs dont expand the wrapper div in firefox so the borders don't go all the way down. How in firefox do I get the wrapper to expand all the way down to hold the floated contents?

I am using margin:0 auto for centering and for floated am using floatxx, position:relative; I get this problem a lot so all help is appreciated.
Reply With Quote

  #2 (permalink)  
Old Dec 23rd, 2006, 21:21
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Floated Divs dont expand centered div in firefox

Sounds like you need to put a clearing div underneath the two floating items.

Code: Select all
.clear {
    width: 100%;
    height: 1px;
    margin: 0 0 -1px;
    clear: both;
}
Place <div class="clear"></div> after the <div> of the last floated element in the wrapper.


Visit here for more info:
http://ryanfait.com/articles/2006/10...ng-css-floats/
Reply With Quote
  #3 (permalink)  
Old Dec 23rd, 2006, 21:33
Reputable Member
Join Date: May 2006
Location: Scotland
Age: 18
Posts: 229
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Floated Divs dont expand centered div in firefox

Thanks that will really come in handy. Would really like some articles like that for my new site.
Reply With Quote
  #4 (permalink)  
Old Dec 24th, 2006, 01:24
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Floated Divs dont expand centered div in firefox

I really need to write some more. I was doing good for a while there.
Reply With Quote
  #5 (permalink)  
Old Dec 24th, 2006, 03:18
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,953
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Re: Floated Divs dont expand centered div in firefox

Quote:
Originally Posted by ryanfait View Post
I really need to write some more. I was doing good for a while there.
Could use some on here too!!

Will be adding a feature for that as soon as I work out the specifics.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
  #6 (permalink)  
Old Dec 24th, 2006, 04:01
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Floated Divs dont expand centered div in firefox

Cool. I'm writing a sticky footer example now. It's quite nice because there are no hacks involved, but there's one minor bug I can't work out. I'll get there soon, though
Reply With Quote
  #7 (permalink)  
Old Dec 27th, 2006, 15:34
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,946
Blog Entries: 1
Thanks: 0
Thanked 29 Times in 29 Posts
Re: Floated Divs dont expand centered div in firefox

One way to simulate the effect of 100% height is with a background image on the body {} so you could put your border etc on that graphic and place your divs accordingly.

something like: background: #FFF url("foo.jpg") repeat-y center top;

Hope that makes sense. As for sticking a footer at the bottom of the page, there are examples of that but its not the "easiest" thing in the world to get right.
__________________
I hate IE 6. Just sayin....
http://www.mevans76.com
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Reply With Quote
  #8 (permalink)  
Old Jan 1st, 2007, 01:17
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Floated Divs dont expand centered div in firefox

Yeah, I've seen many examples, but mine is going to be better (if I start working on it again, soon).
Reply With Quote
Reply

Tags
firefox center div

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] DIVs and Firefox - help! Emzi Web Page Design 4 Oct 4th, 2007 10:42
Divs in IE and Firefox Slimane Web Page Design 6 Sep 24th, 2007 14:07
IE 7 vs Firefox & extra space between divs Kurt Web Page Design 4 Sep 20th, 2007 21:26
Problem with Firefox divs... WillRevera Web Page Design 3 Aug 31st, 2007 16:29
Floated DIV being pushed down in Firefox T34 Web Page Design 4 Jul 20th, 2007 11:57


All times are GMT. The time now is 05:04.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43