ie-css3.htc放在服务器上,也可以正常访问,为什么在IE8上看不到效果呢,百思不得其解呀,你们觉得是什么问题呢?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.cricle{width:100px;height:100px;background: red;border-radius: 50%;position: relative;behavior: url(http://kom3.eisoo.com/css/ie-css3.htc); }
</style>
</head>
<body>
<p class="cricle"></p>
</body>
</html>
高洛峰2017-04-17 11:53:33
Personal testing is OK. Just put it in the root directory and take a look
大家讲道理2017-04-17 11:53:33
Haha, I guessed it, cross-domain is not supported.
If is placed in the root directory of the website and accessed as http://127.0.0.1/index.html
, the CSS file cannot write behavior: url(http://localhost/ie-css3.htc);
instead write behavior: url(http://127.0.0.1/ie-css3.htc);
. However, it is best to use relative paths if the css file is in the same directory as ie-css3.htc. In the same folder, write behavior: url(ie-css3.htc);
Test environment: windows7 + IE8
Also:
The current element must have positioning attributes, such as position:relative
or position:absolute
attributes.
z-index
The value must be higher than the surrounding elements
border-radius
Setting only one corner is invalid
box-shadow
can only be set to #000
text-shadow
The performance under IE is slightly different from Firefox/Safari/Chrome, the reason is unknown
Reference: Let IE6/IE7/IE8 browser support CSS3 attributes