CSS for IE6 and/or IE7 but not Firefox | An Organi...
CSS Hack: Isolate IE6 and/or IE7 from other browsers
I’m working on a new project for a certain product we carry on our website. Everything was fine and dandy until IE6 testing began. That bastard son of Microsoft, should be thrown in the pits, yea! Im looking at you Internet Explorer 6. Its always frustrating when you are getting a website ready and it looks ok with other browsers except for IE6. I needed to find a solution that would render one way in IE6 then render a different way in IE7, FF and other compatible browsers. After trolling the web i found this site from RGaucher that posted the solution (link: http://rgaucher.info/post/2007/10/17/IE6-And-I7-doesnt-have-compatible-CSS-tricks)
Here is the solution:
.yui-g {
margin-left: -70px;
/* THE UNDERSCORE TRICK BELOW APPLIES TO IE6 BUT NOT TO IE7 or FF */
_margin-left: 0px;
display: inline;
}
To isolate IE7 use a DOT instead of UNDERSCORE. See below:
.yui-g {
margin-left: -70px; /* RENDER IN OTHER BROWSERS */
/* THE UNDERSCORE TRICK BELOW APPLIES TO IE6 BUT NOT TO IE7 or FF */
_margin-left: 0px; /* RENDER IN IE6 */
.margin-left: -50px; /* RENDER IN IE7 */
display: inline;
}
update (01/12/09): This hack does not work in Safari.
A good blog design:
POSITION:ABSOLUTE
http://blog.position-absolute.com/web-experience/css-for-ie6-5-common-problems-and-fast-ways-to-fix-them/







