框阴影不会在IE中显示

时间:2013-05-09 19:20:04

标签: html css internet-explorer

interncup-thc.ucoz.com

在Brackets下,在文本周围它应该是绿色阴影,在chrome / firefox上显示但在IE上没有。我有IE 10

怎么了?试图解决这个问题已经有一天了。

1 个答案:

答案 0 :(得分:1)

您将不得不更改HTML以便检测它是否为IE,并根据需要应用相应的类。它会为你的CSS增加更多,但它必须是IE兼容性所必需的。

如果您想要涵盖所有版​​本的IE,那么您将执行以下操作:

<body>标记替换为:

<!--[if lt IE 7 ]><body class="ie6"><![endif]-->
<!--[if IE 7 ]><body class="ie7"><![endif]-->
<!--[if IE 8 ]><body class="ie8"><![endif]-->
<!--[if IE 9 ]><body class="ie9"><![endif]-->
<!--[if (gt IE 9) ]> <body class="modern"><![endif]-->
<!--[!(IE)]><!--><body class="notIE modern"> <!--<![endif]-->

你会申请例如:

body.ie6 #box,
body.ie7 #box,
ody.ie8 #box {
/* This contains the color of the shadow in the CSS3 syntax */
    background: #cccccc;

 /* This contains the blur-radius in the CSS3 syntax */
zoom: 1;
filter:progid:DXImageTransform.Microsoft.Blur(PixelRadius=5);

  /* You must remove the border in IE, since it will be replaced in the next rule */
border: none;

以下是How to Simulate CSS3 box-shadow in IE6-8 Without JavaScript.

的非常好的参考资料
相关问题