Naive Amoeba Posted November 2, 2005 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 Link to comment Share on other sites More sharing options...
Jonas Posted November 2, 2005 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%; Link to comment Share on other sites More sharing options...
Naive Amoeba Posted November 2, 2005 Author Share Posted November 2, 2005 Just tried that, comes out with the same thing.. so i'm guessing * and _ are the same.Thanks anyway. Link to comment Share on other sites More sharing options...
zeehond Posted November 3, 2005 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 Link to comment Share on other sites More sharing options...
Nago Posted November 3, 2005 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? Link to comment Share on other sites More sharing options...
zeehond Posted November 4, 2005 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 Link to comment Share on other sites More sharing options...
Naive Amoeba Posted November 6, 2005 Author Share Posted November 6, 2005 Zeehond, thankyou very much. It works nicely now :)Thanks to everyone else too, i appreciate it. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now