一個滾動代碼,其他瀏覽器都滾的好好的,就IE出現錯誤!氣憤!隨想起IE的條件語句,如果是IE用第一種滾動方式,如果是其他瀏覽器用另外一種方式;
<!–[if IE]>
<script type=”text/javascript”>
new Marquee(“ygjy1”,0,2,395,300,50,0,0)
new Marquee(“jbhc1”,0,2,395,300,50,0,0)
</script>
<![endif]–>
其他瀏覽器:
<!–[if !IE]>
<script type=”text/javascript”>
new Marquee(“ygjy1”,0,3,395,303,20,4000,3000,101);
new Marquee(“jbhc1”,1,3,395,303,20,4000,3000,101);
</script>
<!–<![endif]–>
1、Css if hack條件語法
<!–[if IE]> Only IE <![endif]–>
僅所有的WIN系統自帶IE可識別
<!–[if IE 5.0]> Only IE 5.0 <![endif]–>
只有IE5.0可以識別
<!–[if gt IE 5.0]> Only IE 5.0+ <![endif]–>
IE5.0包換IE5.5都可以識別
<!–[if lt IE 6]> Only IE 6- <![endif]–>
僅IE6可識別
<!–[if gte IE 6]> Only IE 6/+ <![endif]–>
IE6以及IE6以下的IE5.x都可識別
<!–[if lte IE 7]> Only IE 7/- <![endif]–>
僅IE7可識別
<!–[if gte IE 7]> Only IE 7/+ <![endif]–>
IE7以及IE7以下的IE6、IE5.x都可識別
<!–[if IE 8]> Only IE 8/- <![endif]–>
僅IE8可識別
2、DIV+CSS實例教程
CSS實例一:
讓IE6-IE8顯示不同的內容,DIV CSS代碼如下:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>DIV IF條件實例WWW.DIVCSS5.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]–>
<strong>DIVCSS5說明</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實例 www.divcss5.com</title>
新聞熱點
疑難解答