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
哈哈,被我猜到了,不支援跨域。
如果放在網站根目錄下,以http://127.0.0.1/index.html
訪問時,CSS檔案中就不可以寫behavior: url(http://localhost/ie-css3.htc);
而是寫behavior: url(http://127.0.0.1/ie-css3.htc);
但是最好使用相對路徑如果css檔案與ie-css3.htc在同一資料夾下,寫behavior: url(ie-css3.htc);
測試環境:windows7 + IE8
另外:
目前元素一定要有定位屬性,像是position:relative
或是position:absolute
屬性。
z-index
值一定要比周圍元素的高
border-radius
只設定一個角無效
box-shadow
中的顏色只可設定#000
text-shadow
IE下的表現與Firefox/Safari/Chrome有一點點的差異,原因不詳
參考:讓IE6/IE7/IE8瀏覽器支援CSS3屬性