IE provides comment tags which is supported most of the IE version to target specific versions for creating IE Only Stylesheet.
How’s your experience with IE? There is a 99% chance that you’ve had a hair-pulling experience with IE.
We use conditional stylesheets when we face any problems and want to keep our code very clean.
Internet Explorer 9 and lower: You can use conditional comments to load an IE-specific stylesheet for any version that you wanted to target specifically.
!IE = not IE
gt = greater than
gte = greater than or equal
lt = less than
lte = less than or equal
<!--[if IE]> <link rel="stylesheet" type="text/css" href="sample.css" /> <![endif]-->
<!--[if !IE]><!--> <link rel="stylesheet" type="text/css" href="sample.css" /> <!--<![endif]-->
<!--[if IE 8]> <link rel="stylesheet" type="text/css" href="sample.css"> <![endif]-->
<!--[if IE 7]> <link rel="stylesheet" type="text/css" href="sample.css" /> <![endif]-->
<!--[if IE 6.5000]> <link rel="stylesheet" type="text/css" href="sample.css" /> <![endif]-->
<!--[if lt IE 8]> <link rel="stylesheet" type="text/css" href="sample.css" /> <![endif]-->
or,
<!--[if lte IE 7]> <link rel="stylesheet" type="text/css" href="sample.css" /> <![endif]-->
<!--[if gt IE 7]> <link rel="stylesheet" type="text/css" href="sample.css" /> <![endif]-->
or,
<!--[if gte IE 8]> <link rel="stylesheet" type="text/css" href="sample.css" /> <![endif]-->
However, in the beginning of IE version 10, conditional comments are no longer supported in IE.
Internet Explorer 10 & 11: You can create a media query using -ms-high-contrast by which you can place your IE 10 and 11 specific CSS styles.
Because -ms-high-contrast is Microsoft-specific which is only available in IE 10+ and this will only be parsed in Internet Explorer 10 and greater.
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
/* IE10+ CSS styles */}
Content marketing has a hidden tax. It's not the writing itself, it's everything that happens…
Most marketing teams aren't failing because they lack data. They're failing because they can't act…
Email marketing continues to be one of the most effective ways for businesses to communicate,…
Xerox first introduced it around the mid-1970s. The need came up because the management activities…
Investing in the forex market may look to be a dangerous game. With some worthwhile…
The coronavirus outbreak has drastically changed the way we live our lives. Yes, that's absolutely…
View Comments
css styles not loading and working in IE8? Can you please tell me the solution.