2012-04-08 85 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