ie css3.htc不起作用怎么办?
ie css3.htc不起作用是因为不支持跨域。
问题:
ie-css3.htc放在服务器上,也可以正常访问,为什么在IE8上看不到效果呢,百思不得其解?
<!DOCTYPE html> <html> <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> <div></div> </body> </html>
解决办法:
如果放在网站根目录下,以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
更多web前端开发知识,请查阅 HTML中文网 !!