NameSilo

Good CSS Tip

SpaceshipSpaceship
Watch

LeetPCUser

Account Closed
Impact
36
I had a previous problem with the min-height attribute because it works in Firefox but not in IE. There are many solutions out there and some are quite tedious. I found a great hack, although the css won't validate this one thing, but it does save a headache.

#Name
{
min-height:300px;
_height:300px;
}

The min-height works for all browsers except IE and the _height is a hack that no other browsers read but IE respects. So if you need to use a minimum height but you are having troubles, try using the _height hack.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
If you want it to validate, you can do:

Code:
<style type="text/css">
#name {
  min-height: 300px;
}
</style>
<!--[if IE]>
<style type="text/css">
#name {
  height: 300px;
}
</style>
<![endif]-->
 
0
•••
How would you put that in a css file. I don't call CSS in my document but call an actual file.
 
0
•••
Code:
<link rel="stylesheet" href="style.css" type="text/css" />
<!--[if IE]>
<link rel="stylesheet" href="iestyle.css" type="text/css" />
<![endif]-->

And in iestyle.css have the IE CSS fixes like width, etc.

Or you could use link rel for normal and use the style tag for the IE stuff.
 
0
•••
lol way too much code. Cuz then I will have to load up two seperate files of same size. Thanks for the suggestion.
 
0
•••
No, in iestyle.css just put the IE fixes like the height (I meant height in my last post, too.. not width).

The regular stylesheet (style.css) would probably be much larger than iestyle.css
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer
CatchedCatched

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back