用CSS代碼來判斷瀏覽器是Firefox、IE6、IE7的網頁特效代碼

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
 <html xmlns=http://www.w3.org/1999/xhtml>
 <head>
<meta. http-equiv="Content-Type" content="text/html; charset=gb2312" />
 <title>關於用CSS區分Firefox、IE6、IE7</title>
 <style. type="text/css">
 #example{color:red ;}/*firefox*/
* html #example{color:blue;}/*ie6*/
*+html #example{color:green;}/*ie7*/
</style>
</head>
<body>
<div id="example">在FireFox下應爲紅色,在IE6.0下應爲藍色,在IE7.0下應爲綠色。</div>
</body>
</html>
 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章