CSS实例一:
让IE6-IE8闪现差别的模式,DIV CSS代码以下:
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>DIV IF前提实例WWW.CSS5.COM实例</title> </head> <body> 你正在应用: <!--[if IE 7]> <h2>IE7</h2> <![endif]--> <!--[if IE 6]> <h2>IE6</h2> <![endif]--> <!--[if IE 8]> <h2>IE8</h2> <![endif]--> <br><br> <strong>CSS5注明</strong>:如果你的阅读器版本为若干好多即会表现IE多少,针对IE6-IE8执行CSS教程 </body> </html> |
阐明:以上针对差别IE浮现一致网页形式DIV+CSS实例实验。
DIV+CSS实例二:
让IE6-IE8体现不同CSS名目成就,DIV CSS代码下列:
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>CSS IF前提hack实例 css5.com.cn</title> <!--[if IE 6]> <style type="text/css"> .CSS5{ color:#F00;} </style> <![endif]--> <!--[if IE 7]> <style type="text/css"> .CSS5{ color:#FF0;} </style> <![endif]--> <!--[if IE 8]> <style type="text/css"> .CSS5{ color:#00F;} </style> <![endif]--> </head> <body> <div class="CSS5"> DIV CSS执行默示:<br> 我在IE6下是红颜色,在IE7下是黄色调,在IE8下是蓝颜色 </div> </body> </html> |
注明:以上试验仅实验IE6-IE8下if HACK。
如需转载,请注明文章出处和来源网址:http://www.divcss5.com/css-hack/c52963.shtml