Jump to content

Min-height, IE and height:100% problem


Naive Amoeba

Recommended Posts

Hi,I have a website that will have a min-height of 100%, and stretch if the text is more than that. In IE, however, it doesn't allow min-height (as many CSS developers know). I tried using this hack:

min-height: 100%;height: auto;_height: 100%;

But it doesn't work in IE, although using _height: ***px does. I don't want an absolute value though, as I'd like it to stretch like it does in good ol' firefox.Any ideas?Thanks a lot,Matt

Link to comment
Share on other sites

Hmm, never seen _height used before, but I know that you can use *height, and other browsers will skip the css, while IE will output it. Unless _height does the same, and the problem is with the percentage thing...So, try usingheight: auto;*height: 100%;

Link to comment
Share on other sites

Hi,I have a website that will have a min-height of 100%, and stretch if the text is more than that. In IE, however, it doesn't allow min-height (as many CSS developers know). I tried using this hack:
min-height: 100%;height: auto;_height: 100%;

But it doesn't work in IE, although using _height: ***px does. I don't want an absolute value though, as I'd like it to stretch like it does in good ol' firefox.Any ideas?Thanks a lot,Matt

try my code belowcopy/paste en give a smile  :o <html><style type="text/css"><!--   html, body {  height:100%; }body {  margin:0;  padding:0; }div.mainDiv {  position:relative;  min-height:100%;  height:100%;  width:400px;  background-color:#F00;  }/* mozilla hax \*/html>body div.mainDiv{   height:auto;}/* mozilla hax */--></style><body>	<div class="mainDiv">  content Text	</div>	</body></html>

I hope this fixes ur problem :)

Link to comment
Share on other sites

for IE, whatever element you're using, make the same element in your css sheet, like..

.main { height:100%; }.main { height:expression(document.body.clientHeight + "px"); }

the second one will only be parsed by windows MSIE, although it will make your CSS not w3 standard. any other non-msie browser will just read the first one. MSIE will see the second and use that value instead.Also, I could never get "height=100%" to work in firefox without any additional text after it. Are you a warlock?

Link to comment
Share on other sites

for IE, whatever element you're using, make the same element in your css sheet, like..
.main { height:100%; }.main { height:expression(document.body.clientHeight + "px"); }

the second one will only be parsed by windows MSIE, although it will make your CSS not w3 standard. any other non-msie browser will just read the first one. MSIE will see the second and use that value instead.Also, I could never get "height=100%" to work in firefox without any additional text after it. Are you a warlock?

The problem is that firefox not knows that de Body and HTML tag are 100% height.So put this ur CSShtml,body {height:100%;}Also is this usefull/* mozilla hax \*/html>body div.mainDiv{ height:auto;}/* mozilla hax */try it, if it's still not working let us know :)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...