Naive Amoeba 0 Posted November 2, 2005 Report Share Posted November 2, 2005 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 Quote Link to post Share on other sites
Jonas 151 Posted November 2, 2005 Report Share Posted November 2, 2005 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%; Quote Link to post Share on other sites
Naive Amoeba 0 Posted November 2, 2005 Author Report Share Posted November 2, 2005 Just tried that, comes out with the same thing.. so i'm guessing * and _ are the same.Thanks anyway. Quote Link to post Share on other sites
zeehond 0 Posted November 3, 2005 Report Share Posted November 3, 2005 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 <{POST_SNAPBACK}> 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 Quote Link to post Share on other sites
Nago 0 Posted November 3, 2005 Report Share Posted November 3, 2005 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? Quote Link to post Share on other sites
zeehond 0 Posted November 4, 2005 Report Share Posted November 4, 2005 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? <{POST_SNAPBACK}> 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 Quote Link to post Share on other sites
Naive Amoeba 0 Posted November 6, 2005 Author Report Share Posted November 6, 2005 Zeehond, thankyou very much. It works nicely now :)Thanks to everyone else too, i appreciate it. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.