ie-css3.htc参数无效,ie-css3.htc怎么用?
css帶來的便利是很容易感受的到的,但惡心的是它在ie下的不兼容,所以某位牛人現身寫了個ie-css3.htc,允許你在ie下去使用css3的部分東西。
ie-css3.htc是一個可以讓IE瀏覽器支持部份CSS3屬性的htc文件,不只是box-shadow,它還可以讓你的IE瀏覽器支持圓角屬性border-radius和文字陰影屬性text-shadow。
ie-css3的使用方法很簡單,先下載它并放到你的項目目錄中
在你需要使用css3的樣式里加入behavior: url(js/ie-css3.htc);就可以了(括號里是ie-css3.htc的地址)下載地址:https://links.jianshu.com/go?to=http%3A%2F%2Ffetchak.com%2Fie-css3%2F
用法大致如下:.box {
-moz-border-radius: 15px; /* Firefox */
-webkit-border-radius: 15px; /* Safari and Chrome */
border-radius: 15px; /* Opera 10.5+, future browsers, and now also Internet Explorer 6+ using IE-CSS3 */
-moz-box-shadow: 10px 10px 20px #000; /* Firefox */
-webkit-box-shadow: 10px 10px 20px #000; /* Safari and Chrome */
box-shadow: 10px 10px 20px #000; /* Opera 10.5+, future browsers and IE6+ using IE-CSS3 */
behavior: url(ie-css3.htc); /* This lets IE know to call the script on all elements which get the 'box' class */
}ie-css3.htc 加強版
下載地址:https://links.jianshu.com/go?to=http%3A%2F%2Ffiles.cnblogs.com%2Faiyuchen%2Fie-css3.htc.zip
最近用到了這個東西,發現動態改變div的內容之后,這段腳本生成的vml會出現變形。。
所以加了一個手動刷新的函數,通過innerHTML賦值之后調用一下就可以了el.innerHTML = '....';
if(window.update_css3_fix) update_css3_fix(el);
如果使用jquery就不用這么麻煩,在你的框架里加一段(function()
{
if (!jQuery.browser.msie) return;
jQuery.fn.__ohtml__ = jQuery.fn.html;
jQuery.fn.html = function(value)
{
jQuery(this).__ohtml__(value);
this.each(function()
{
update_css3_fix(this);
});
return this;
};
})();
總結
以上是生活随笔為你收集整理的ie-css3.htc参数无效,ie-css3.htc怎么用?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 我的世界服务器端口文件夹,我的世界手机版
- 下一篇: 红米note2移动4g在哪里显示无服务器