Answer: Following is the example of conditional statement in CSS.
<head>
<style type="text/css">
body
{
color:blue;
}
</style>
<!--[if IE 7]>
<style type="text/css">
body {
background-color:red;
}
</style>
<![endif]-->
</head>
If this code will run in IE7 browser, the background color of the page will be red, for other browser it will be default color (white).
Asked In: Many Interviews |
Alert Moderator