Tuesday, May 06, 2008

Conditional statement in CSS

You must have came across some .css issues related with the browser behavior. Some of the styles that works in IE doesn't work in FireFox.

In that situation you need to write conditional code for both browsers.
Below is the sample code that demonstrate how to write conditional statement tin CSS.


<html>
<head>
<title>Conditional CSS</title>
<style type="text/css">
body
{
color:blue;
}
</style>
<!--[if IE 7]>
<style type="text/css">
body {
background-color:red;
}
</style>
<![endif]-->
</head>

<body>
<p>
SHEO NARAYAHN
</p>
</body>
</html>

For more visit: http://www.dotnetfunda.com/articles/article15.aspx

No comments: