Welcome to the Geeks & God Static Archive. Read more »

CSS wrapper not stretching for content in FF

Joined: 11/28/2008

I have a site designed using CSS floats, and my wrapper isn't stretching to contain the content. The CSS for the container is as follows:

CODE
#container {
text-align: left;
width: 760px;
min-height: 1000px;
background: white;
border-right: 1px black solid;
border-left: 1px black solid;
margin: 0 auto;
}

In fact, my min-height is working more like just plain "height," since it's staying at 1000px no matter what, and if I take that line out there practially is no container.

Works fine in IE of course, since they automatically stretch.

Thanks.

Joined: 11/28/2008
Isn't stretching which way?

Isn't stretching which way? Height?
http://www.complexspiral.com/publications/containing-floats/

Without further explanation or example (that includes markup) couldn't help more.

Joined: 11/28/2008
http://www.uppervent.com/css/

http://www.uppervent.com/css/articles1.php

There's what i've got. The container isn't stretching heightwise for the content, and it seems the footer isn't clearing the content, either.... it was once, but then when i started trying to get the container to stetch it stopped clearing correctly.

Joined: 11/28/2008
if you're floating...then

if you're floating...
then clear your floats at the footer.

CODE
#footer {
clear:both;
}
Joined: 11/28/2008
I've already done that, but

I've already done that, but it's not doing it.

bob
bob's picture
Joined: 11/28/2008
This is probably more of a

This is probably more of a hack than a solution, but you could try setting your overflow: hidden; Yeah, I know, "hidden" should clip your container content, but for some odd reason it works for me every once in awhile.

A better solution would be to look through all your CSS to make sure your you don't have any weird heights, margins, paddings, or floats that's messing things up.

Joined: 11/28/2008
Couple of things...Validate

Couple of things...
Validate your html first
Color your id's and classes or use FF developer extension... "display block" "display id and classes"
I see a few issues like Bob mentioned
Just curious... what are you using the min-height for?

Some articles which might help
http://www.greywyvern.com/code/min-height-hack.html
http://www.orderedlist.com/articles/clearing_floats_fne

Joined: 11/28/2008
also, my own min-height hack

also, my own min-height hack works like this

CODE
#id {
height: 1000px;
}
*>#id {
height:auto;
min-height:1000px;
}
Joined: 11/28/2008
You've got no separation of

You've got no separation of your content in your html.

It should look something like (with or without a "container"):

CODE
<div id="nav">nav</div>

<div id="content">content</div>

<div id="footer">footer</div>

But what you've got is:

CODE
<div id="nav">nav</div>

content

<div id="footer">footer</div>