简体   繁体   English

IE hacks为什么不为我工作?

[英]Why don't IE hacks work for me?

I'm having a problem with dropshadow and other hacks in IE. 我在dropshadow和IE中的其他黑客方面遇到问题。 I have seen lots and lots of the fixes for IE. 我已经看到了很多关于IE的修复程序。 I cannot get them to work for me and I cannot find an explanation of why. 我无法让他们为我工作,也找不到原因的解释。

Here is an example of one of the hacks I have tried: http://i.imgur.com/31Dra.png 这是我尝试过的一种黑客手段的示例: http : //i.imgur.com/31Dra.png

My code and webpage are on the left. 我的代码和网页在左侧。 The website this hack is taken from is: http://robertnyman.com/2010/03/16/drop-shadow-with-css-for-all-web-browsers/ 黑客入侵的网站是: http//robertnyman.com/2010/03/16/drop-shadow-with-css-for-all-web-browsers/

What really gets me is that it will work on that site in IE. 真正让我着迷的是它将在IE中的该网站上运行。 I also have the source inspected (in chrome) but the page is displayed in IE. 我也检查了源(chrome),但是页面显示在IE中。

This is IE 8, just to clarify. 这是IE 8,仅供说明。

Any explanation of this would be much appreciated. 任何对此的解释将不胜感激。

HTML: HTML:

<head>
    <link REL=StyleSheet HREF="style.css" TYPE="text/css" MEDIA=screen />
</head>
<body>
    <div class="shadow">Nothing to see, move along.</div>
</body>

CSS: CSS:

.shadow { .shadow {
-moz-box-shadow: 3px 3px 4px #000; -moz-box-shadow:3px 3px 4px#000;
-webkit-box-shadow: 3px 3px 4px #000; -webkit-box-shadow:3px 3px 4px#000;
box-shadow:3px 3px 4px #000; box-shadow:3px 3px 4px#000;



-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')"; -ms-filter:“ progid:DXImageTransform.Microsoft.Shadow(Strength = 4,Direction = 135,Color ='#000000')”;


filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000'); 过滤器:progid:DXImageTransform.Microsoft.Shadow(Strength = 4,Direction = 135,Color ='#000000');

background-color:00ccff; 背景色:00CCFF;
} }

It's because you have not accepted the security risk alert at the top of the browser, since the "hacks" are implemented in ActiveX. 这是因为您未在浏览器顶部接受安全风险警报,因为在ActiveX中实现了“黑客”。

Also, see CSS dependent on ActiveX? 另外,请参见CSS是否依赖ActiveX?

Most likely caused by not setting the correct DOCTYPE. 最有可能是由于未设置正确的DOCTYPE而引起的。 Try adding <!DOCTYPE html> to the top of your document 尝试将<!DOCTYPE html>添加到文档顶部

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM