I have a CSS/jQuery Checkbox style script: http://jsfiddle.net/BwaCD/
The problem is, in current browsers in order for the span to float over the input, the input's position must be absolute. But in IE8 & below, the script will not work and therefore I'm left with and absolutely positioned input that is just floating over other elements. I am not asking for the script to work in IE8 & below.
I want to know how I can use CSS to set a specific style if it is IE8 and below. I guess jQuery would be acceptable if it's necessary, but I don't think it is. I know this can be done with just CSS & HTML I just don't know how.
http://code.tutsplus.com/tutorials/quick-tip-how-to-target-ie6-ie7-and-ie8-uniquely-with-4-characters--net-10575
on the example:
color : green\9;
\9
didn't work for ie11, but\0
worked!Conditional comments would work (
<!--[if lte IE 8]><stylesheet><![endif]-->
), but if you want to do it all in the stylesheet, there is a way:The important thing here is the "\9", which has to be exactly "\9". I'm not clear on exactly why this is.
EDIT: The \9 hack isn't enough by itself. To exclude IE9, you also need the
:root
hack:Other browsers besides IE might support
:root
, so combine it with the \9 hack if you're using it to target IE9.I solved in this way for the grab cursor in Internet Explorer:
Files tree:
Good references:
I have a useful solution for IE 10 and 11. The script checks for IE and version and then appends .ie10 or .ie11 class to the tag.
That way you can write specific rules like .ie10 .something {} and they get applied only when the browser is IE 10 or 11.
Check it out, it's useful for graceful degradation, tested on a few commercial sites and not really hacky: http://marxo.me/target-ie-in-css
Target ALL VERSIONS of IE :
Target everything EXCEPT IE
Target IE 7 ONLY
Target IE 6 ONLY
Target IE 5 ONLY
Target IE 5.5 ONLY
Target IE 6 and LOWER
Target IE 7 and LOWER
Target IE 8 and LOWER
Target IE 6 and HIGHER
Target IE 7 and HIGHER
Target IE 8 and HIGHER
How about that?
http://www.quirksmode.org/css/condcom.html
Or that if you don't like those statements
http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-how-to-target-ie6-ie7-and-ie8-uniquely-with-4-characters/