There might come a requirement where you will want to switch the styling of the html elements according to browser and mainly IE. For example, to make your view IE8 aware you can define a class on the body with IE’s conditional comments like:
<!--[if IE 8]><body class="ie8"><![endif]--> <!--[if !IE 8]>--><body><!--<![endif]--> <div> This is a sample text which appears blue in IE8 and red in other browsers. <div> </body>
and then you can define the styling like this:
div{ background-color:#bff; } .ie8 div{ background-color:#ffb; }
Now with above changes done, the background color for the div on IE8 in the body will be #FFB and for other browser the background color will be #BFF.
Recent Comments