建站学 - 轻松建站从此开始!

建站学-个人建站指南,网页制作,网站设计,网站制作教程

当前位置: 建站学 > 网页设计 > css教程 >

CSS兼容:用CSS代码来判断浏览器是Firefox、IE6、IE7的代码

时间:2010-08-28 23:59来源: 作者: 点击:
CSS兼容:用CSS代码来判断浏览器是Firefox、IE6、IE7的代码
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd> 
  2. <html xmlns=http://www.w3.org/1999/xhtml> 
  3.  <head> 
  4.  <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 
  5.  <title>关于用CSS区分Firefox、IE6、IE7</title> 
  6. <style. type="text/css"> 
  7. #example{color:red ;}/*firefox*/  
  8. * html #example{color:blue;}/*ie6*/  
  9. *+html #example{color:green;}/*ie7*/  
  10. </style> 
  11. </head> 
  12. <body> 
  13. <div id="example">在FireFox下应为红色,在IE6.0下应为蓝色,在IE7.0下应为绿色。</div> 
  14. </body> 
  15. </html>
(责任编辑:admin)
织梦二维码生成器
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:点击我更换图片