htc支持CSS3

<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>html5标签</title>

    <style>

.round{
    width: 100px;
    height: 100px;
    background: red;
    border-radius: 50px;
    box-shadow: 0px 0px 20px #000;
}

    </style>

</head>
<body>
<div class="round">

</div>
</body>
</html>

css3的border-radius在IE下没有效果,解决方法:

首先下载ie-css3.htc脚本,然后在css中加入:

behavior: url(ie-css3.htc);

当你使用了这个htc文件后,你的CSS里面,只要写有box-shadow, -moz-box-shadow或-webkit-box-shadow的任何一种,IE就会渲染。

当使用了这个htc文件后,你不能这样写box-shadow: 0 0 10px red; 而应该是box-shadow: 0px 0px 10px red; 否则IE中会失效。

不支持RGBA值中的alpha透明度。
不支持inset内阴影。
不支持阴影扩展。
阴影在IE中只会显示为黑色,不管你设置成其它什么颜色。

<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>html5标签</title>

    <style>
    *{
         behavior: url(ie-css3.htc); 
    }
.round{
    width: 100px;
    height: 100px;
    background: red;
    border-radius: 50px;
    box-shadow: 0px 0px 20px #000;
}

    </style>

</head>
<body>
<div class="round">

</div>
</body>
</html>

posted @ 2015-09-04 23:01  tinyphp  Views(708)  Comments(0Edit  收藏  举报