Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

All IE css hack

Is there css hack for all IE browsers. Not specific IE versions.

I tried

@media \0screen\,screen\9 {
    body { background: green; }
} 

but it doesn't work in IE7 and IE11.

like image 988
Praveen Avatar asked Apr 29 '14 13:04

Praveen


People also ask

Can you hack with CSS?

As it is with every coding language, there are several shortcuts or hacks with CSS that allow you to write cleaner code, improve design elements, and save valuable time. Furthermore, you can directly insert these snippets to your site using a code editor.

How do I target IE only with CSS?

Internet Explorer 10 & 11 : Create a media query using -ms-high-contrast, in which you place your IE 10 and 11-specific CSS styles. Because -ms-high-contrast is Microsoft-specific (and only available in IE 10+), it will only be parsed in Internet Explorer 10 and greater.

How do I fix CSS issues in IE11?

To fix CSS issues in IE11, we can use the following checklist to troubleshoot: Make sure that the HTML and CSS is valid - using W3C validator. Check that the CSS property is valid in IE11 using CanIUse. Use CSS resets (such as Eric Myers CSS reset, Normalize.


1 Answers

<!--[if IE]>
    <link rel="stylesheet" type="text/css" href="all-ie-only.css" />
<![endif]-->

more information can be found here: http://css-tricks.com/how-to-create-an-ie-only-stylesheet/

UPDATE as ElKabong mentioned in the comments and you will read while following the link..

Note that IE 10 and up DO NOT support conditional comments at all so this seems to be a bit of a nightmare and I have no easy way solution right now for that. But you can find more information while following the link mentioned above and also read trough the comments.

like image 182
caramba Avatar answered Sep 27 '22 03:09

caramba