How to write conditional statement in CSS?
Following is the example of conditional statement in CSS.
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).
<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).
No comments:
Post a Comment