日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 前端技术 > HTML >内容正文

HTML

[HTML] Google IE-x.js 解决IEx与W3C标准的冲突

發(fā)布時間:2024/4/14 HTML 49 豆豆
生活随笔 收集整理的這篇文章主要介紹了 [HTML] Google IE-x.js 解决IEx与W3C标准的冲突 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

如果分別用IE5、IE6、IE7瀏覽同一個網(wǎng)頁,將可能出現(xiàn)不一樣的效果。
這是它們之間對CSS的解析選擇器不一樣或錯誤和個別bug所導(dǎo)致。為了解決這些錯誤和bug。
我們不得不找到一個能平衡于它們之間的解決方法。
如png透明問題在IE5、IE6下無法顯示出其效果,我們可能會使用CSS hack或者引入外部JavaScript來實現(xiàn)。譬如前面我提到過用pngfix的那個方法就是調(diào)用外部JavaScript來解決在IE5、IE6下png透明問題。當(dāng)然還有更多的方法。
而現(xiàn)在有種更加完美的方法能兼容IE5、IE6、IE7的CSS選擇器解析不一樣問題。那就是: ie7 – js
ie7 – js中是一個JavaScript庫(解決IE與W3C標(biāo)準(zhǔn)的沖突的JS庫),使微軟的Internet Explorer的行為像一個Web標(biāo)準(zhǔn)兼容的瀏覽器,支持更多的W3C標(biāo)準(zhǔn),支持CSS2、CSS3選擇器。它修復(fù)了許多的HTML和CSS問題,并使得透明PNG在IE5、IE6下正確顯示。
目前該ie7 – js版本: 2.0 beta 3
用法:
直接引用Google Code服務(wù)器上的js文件。
?
<!--[if lt IE 7]>
<script src=http://up.2cto.com/2013/0222/20130222021950559.png";</script>
<![endif]-->
<!--[if lt IE 8]>
<script src=http://up.2cto.com/2013/0222/20130222021951759.png";</script>
<![endif]-->
<!--[if lt IE 9]>
<script src=http://up.2cto.com/2013/0222/20130222021951794.png";</script>
<![endif]—>


IE7.js
使IE5、IE6升級至兼容IE7
注釋使Internet Explorer版本號低于IE7的IE瀏覽器載入該代碼。
<!–[if lt IE 7]>
<script src=”http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE7.js” type=”text/javascript”></script>
<![endif]–>
?
IE8.js
使IE5、IE6、IE7支持更多的W3C標(biāo)準(zhǔn)(修復(fù)了許多的HTML和CSS問題)。
注釋使Internet Explorer版本號小于8的IE瀏覽器載入該代碼,而其它符合標(biāo)準(zhǔn)的瀏覽器則會忽略該代碼,并在IE8出來后不干擾其工作。
<!–[if lt IE 8]>
<script src=”http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js” type=”text/javascript”></script>
<![endif]–>
?
讓png透明的語句.
<script src="IE8.js">IE7_PNG_SUFFIX=".png";</script>
?
E7.js is a JavaScript library to make Microsoft Internet Explorer behave like a standards-compliant browser. It fixes many HTML and CSS issues and makes transparent PNG work correctly under IE5 and IE6.
Status
Current version: 2.1 beta4.
Usage
IE7.js
Upgrade MSIE5.5-6 to be compatible with MSIE7.
<!--[if lt IE 7]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE7.js"></script>
<![endif]-->
IE8.js
Upgrade MSIE5.5-7 to be compatible with MSIE8.
<!--[if lt IE 8]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js"></script>
<![endif]-->
You do not need to include IE7.js if you are using IE8.js
IE9.js
Upgrade MSIE5.5-8 to be compatible with modern browsers.
<!--[if lt IE 9]>www.2cto.com
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
<![endif]-->
You do not need to include IE7/IE8.js if you are using IE9.js
PNG
The script only fixes images named: *-trans.png
If you want the fix to apply to all PNG images then set a global variable as follows:
var IE7_PNG_SUFFIX = ".png";
You must set this variable before including the IE7.js script. Alternatively, you can set the variable inside the IE7.js script element:
<script src="IE8.js">IE7_PNG_SUFFIX=".png";</script>
The suffix will ignore query string parameters. For more fine-grained control you can also set IE7_PNG_SUFFIX to a RegExp object. If you want to use an alternative PNG solution then set the suffix to something that cannot possibly match:
var IE7_PNG_SUFFIX = ":";
By default, the PNG will be stretched (this simulates tiling). If you want to turn this off then set the no-repeat property as follows:
div.example {
? background: url(my-trans.png) no-repeat;
}
Unfortunately, the transparent background image cannot be tiled (repeated) using background-repeat. Nor can it be positioned using background-position.

轉(zhuǎn)載于:https://www.cnblogs.com/jqmtony/p/3808296.html

總結(jié)

以上是生活随笔為你收集整理的[HTML] Google IE-x.js 解决IEx与W3C标准的冲突的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。