Rolf
Rolf

Reputation: 33

box shadows not working in IE10

I'm trying to add a shadow to an element (right & left only). It works in Chrome, Opera, Firefox, Safari but not in IE10. I'm kinda new to this so I'm thinking I must have make a mistake. The link to the page: http://www.sytemaker.com/other-sites/ets The code:

<!DOCTYPE html>
<html>
<head>
<style> 
div
{
width:300px;
height:100px;
background-color:yellow;
box-shadow: 6px 0 4px  -4px #222, -6px 0 4px  -4px #222;}
</style>
</head>
<body>

<div></div>

</body>
</html>

Upvotes: 1

Views: 330

Answers (3)

Nogard
Nogard

Reputation: 1789

If you want to target IE8 and earlier you can also use CSS property -ms-filter, but be aware that it is deprecated in IE9+. Details on MSDN

For example:

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

Upvotes: 0

Mr.G
Mr.G

Reputation: 3559

Try this:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

Upvotes: 0

Alessandro Minoccheri
Alessandro Minoccheri

Reputation: 35973

IE is probably not using IE10 mode, you can check with Developer Tools (press F12).

If not, the easiest fix is to add this inside head:

<meta http-equiv="X-UA-Compatible" content="IE=edge">

Upvotes: 2

Related Questions