Forum Moderators: not2easy
I need some help here. I’m in a situation were I need to make some code specific for IE. This can be done, by adding an underscore as the first character but this isn’t valid according to W3C’s Validator. Since I’d like to write valid code I need another way to make the code IE specific. Preferably one solution for all versions, if possible. I would prefer just one stylesheet.
Example:
#iframeWrapper {
_float:left;
padding-right:125px;
_padding-right:0px;
padding-left:125px;
_padding-left:0px;
}
the "star HTML" hack should do nicely. It applies to all versions of IE but can be hidden from IE/Mac if required.
#yourdiv {rules} = all browsers
* html #yourdiv {rules} = IE (allversions) only
IE "thinks" it has another root element above <html> apparently and by accessing it using the * (asterisk) html specificity only IE will read the above rule as being valid
it can then be hidden from Mac using the commented backslash hack if required (which when using floats might be required ;))
/* hide from IE/Mac \*/
* #yourdiv {rules}
/* end hide */
now only IE/Win will read the rule..
and it validates
Suzy