Page 1 of 1

Auto height!

Posted: Thu Jan 14, 2010 10:33 pm
by skacke
Hey guys!

I have another div problem -.-'

When i try to auto height my container div, it only works in ie. How do i fix this?

CSS

Code: Select all

div.container { background-color: black;
color: red;

     border: 1px solid gray;
     width:1000px;
     top:100px;
     margin-left:auto;
     margin-right:auto;
     z-index:1;
     top:0px;
     height:100%;
     height:auto !important; 
     height:100%;

     min-height:100%; 

}

Code: Select all

echo "<div class='container' style='position:relative;'>";

Re: Auto height!

Posted: Thu Jan 14, 2010 11:35 pm
by Torniquet
well for a start, your calling a top placement twice, you have 3 heights in there. and a min height of 100%. my best guess is your confusing the poor thing lol.

Code: Select all

div.container { 
    background-color: black;
    color: red;
     border: 1px solid gray;
     width:1000px;
     top:100px;
     margin-left:auto;
     margin-right:auto;
     z-index:1;
     min-height:200px;
     position:absolute;
}

try something more like that. (im no css expert btw :p)

Re: Auto height!

Posted: Thu Jan 14, 2010 11:48 pm
by skacke
Guess i'm to tired to think correctly


EDIT:
Tried it and it still does not work :(

Re: Auto height!

Posted: Fri Jan 15, 2010 7:05 pm
by Torniquet
ok i have tried it, and it works in IE,FF,saffari and chrome.

although i had to change the position back to relative :p

other than that, the box expands to fit and contracts to the minimum height set.