These are my legal CSS Hacks for fixing web browser quirks or outright bugs. Please enjoy, I have been working on them for years. May it help you if you need them. Please check out my [Live CSS Hacks Test Page at Bitbucket] MIRROR at [Live CSS Hacks Test Page at GitHub] and also [BrowserHacks.com] where I sent new hacks and test submissions for the site.
A while back I saw the need for methods of targeting different versions of Internet Explorer other than old ones. Nothing existed to target version 9 for example, and the Conditional Comment was rather cumbersome in that you could not include it within an existing style sheet. That of course would not work with a ‘greater than or equal’ IE 9 CSS block. Here are several methods I have created for this purpose.
First is the IE property combination with :root to rule out IE 8 and lower:
:root .selector { property:value\0; } /* IE 9+ (and old Firefox) */ Author: Jeff Clayton
Example Usage:
:root .selector { color:red\0; } /* IE 9+ (and old Firefox) */ Author: Jeff Clayton
Old versions of Firefox that would be most likely deemed unimportant do still show up, but I am one who loves to do surgical and direct methods, so try this one instead:
_::selection, .selector { property:value\0; } /* IE 9+ (Only) */ Author: Jeff Clayton
And the example then becomes:
_::selection, .selector { color:red\0; } /* IE 9+ (Only) */ Author: Jeff Clayton
This has been tested up through IE 11 which is current at the time of this posting.
For one-liners this is great but also I like to have media queries or @supports blocks. This one works for IE 9 and another I have crafted for IE 9+.
/* Internet Explorer 9 (Only) */ @media screen and (min-width:0) and (min-resolution:.001dpcm) { .selector { property:value; } } Author: Jeff Clayton
And for the Internet Explorer 9+ version:
/* Internet Explorer 9+ (Only) */ @media screen and (min-width:0) and (min-resolution:+72dpi) { .selector { property:value; } } Author: Jeff Clayton
Enjoy!
Jeff
Hey found your CSS hacks to be so useful thanks for sharing..!! Keep up the good work
LikeLike
Glad it helped you, thanks for the response!
LikeLike