如何从其他域添加Internet Explorer行为文件(.htc)?

时间:2010-10-25 15:58:59

标签: html css internet-explorer

我正在重新设计我的Tumblr博客,并使用CSS3 Pie为Internet Explorer添加了一些眼睛。这个问题是CSS3 Pie使用的Internet Explorer特定文件(.htc)只能在与HTML文件相同的域中提供,这是我在Tumblr上无法做到的。

事情是,如果没有该文件,网站就会破坏IE6& IE7(我使用的是HTML5语法,显然这些浏览器即使在Modernizr的帮助下也不太喜欢它。)

那么,您是否知道从提供HTML的其他域添加此类文件的方法?不管它有多酷。

1 个答案:

答案 0 :(得分:0)

我建议使用IE的条件注释来优雅地警告用户不支持他们的浏览器,或者为IE用户重新格式化内容。

<!--[if IE 6]><link rel="stylesheet" type="text/css" href="includes/styleIE6.css" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" type="text/css" href="includes/styleIE7.css" /><![endif]-->
<!--[if IE 8]><link rel="stylesheet" type="text/css" href="includes/styleIE8.css" /><![endif]-->

我猜的另一种选择比你建议的“.htc”黑客更容易。是使用基本的java脚本重定向。如果用户使用IE(小于IE9),则将它们重定向到简化的IE浏览器网页。