2012-04-08 88 views
0

我在ASP.NET中,但问题是完全与HTML相关。我有这样的下面的代码:悬停IE8锚文字阴影

<asp:Panel runat="server" CssClass="message-box"> 
    <asp:LinkButton ID="LogoutLinkButton" runat="server">Logout</asp:LinkButton> 
</asp:Panel> 

等效HTML是:

<div class="message-box"> 
    <a href="#">Logout</a> 
</div> 

而CSS类:

a { 
    text-decoration: none; 
    color: inherit; 
} 

.message-box { 
    width: 1000px; 
    margin: 0 auto; 
    text-align: right; 
} 

.message-box a:hover { 
    text-decoration: underline; 
    text-shadow: 0.1em 0.1em 0.2em black; 
} 

演示可以jsFiddle找到。

锚文本的文本阴影在IE8/IE9中不起作用。我怎样才能做到这一点?

谢谢。

+0

可能重复:http://stackoverflow.com/questions/6905658/css3-text-shadow-in-ie9 – MrWhite 2012-04-08 09:33:54

回答

3

text-shadow是一个css3属性。所以你不能在IE中使用它。 但是你可以用户过滤:阴影,以满足您的要求

+0

感谢您的答复。我试过使用.message-box a:hover { \t text-decoration:underline; \t \t text-shadow:0.1em 0.1em 0.2em black; \t filter:shadow(color =#000000,direction = 135,strength = 5); \t -ms-filter:“progid:DXImageTransform.Microsoft.Shadow(color =#000000,direction = 135,strength = 5)”; }但它不起作用。 – 2012-04-08 09:16:13

+1

在附注中,MDN通常是浏览器兼容性的好来源,例如, [mdn上的文本 - 影子浏览器支持](https://developer.mozilla.org/en/CSS/text-shadow#Browser_compatibility) – Jeroen 2012-04-08 09:24:26

+0

@Tapas元素必须具有_layout_才能使过滤器工作。 – MrWhite 2012-04-08 10:01:45