Neat trick
Posted on November 26, 2003 @ 14:07 in Webdesign
A very neat CSS trick. A standards compliant browser disregards CSS properties that it doesn't know. Luckily IE isn't all that standards compliant, so that with some trickery we can feed the 5.x and 6.x versions of IE different values for officially non-existent properties, like so:
element {
property: value1; /* all browsers */
_property: value2; /* resets property for IE 5 & 6 */
_prop\erty: value3; /* resets property for IE6 only */
}
Too bad we still need hacks like this, but when it's only one or two properties that you need to adjust to make your design work across all the browsers, I find it easier to keep that information 'inline' instead of using the midpass hack.
Comments and Trackbacks
Is this working in NS?
Posted by Lilly on February 22, 2004 @ 18:02
I suppose you mean, is Netscape affected? Well, I don't know about NS4, but NS6+ is based on the Mozilla code, so yes, this hack will allow you to feed IE some information that NS will ignore. It works just fine for the other Mozilla browsers.
Posted by Frank on February 22, 2004 @ 18:26
Post a comment
Comments and trackbacks have been closed on this site. My apologies.
Since MT-Blacklist inexplicably stopped working I had no other recourse than close comments and trackbacks to stop the spam. I've been meaning to correct this for quite a while, but life got in the way... in a good way I should add.