简体   繁体   中英

Why don't IE hacks work for me?

I'm having a problem with dropshadow and other hacks in IE. I have seen lots and lots of the fixes for 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

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/

What really gets me is that it will work on that site in IE. I also have the source inspected (in chrome) but the page is displayed in IE.

This is IE 8, just to clarify.

Any explanation of this would be much appreciated.

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:

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



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


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

background-color: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.

Also, see CSS dependent on ActiveX?

Most likely caused by not setting the correct DOCTYPE. Try adding <!DOCTYPE html> to the top of your document

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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