2012-02-03 76 views
0

在我的網站中,當光標鼠標懸停時,我的所有鏈接都加下劃線。對於特殊情況我有例外。所以我有一些ActionLink,我希望鏈接被點綴,並且懸停鏈接必須加下劃線。我無法做到這一點。當光標懸停時,使ActionLink顯示爲點和純色

這裏是我做的:

@Html.ActionLink("Lire la suite...", "Details", new { slug = @post.Slug } , new { @class = "dotted-link" }) 

的CSS:

.dotted-link 
{ 
text-decoration: none; 
border-bottom-style:dotted; 
border-bottom-width: 1px; 
} 

結果:

enter image description here

結果時,懸停它:

enter image description here

正如你所看到的,我有一個虛線的邊框和一個簡單的邊框?!

實現此目的的最佳方法是什麼?

謝謝。

回答

0
a.dotted-link { 
    text-decoration: none; 
    border-bottom-style: dotted; 
    border-bottom-width: 1px; 
} 

a.dotted-link:hover { 
    border-bottom-style: none; 
} 
+0

非常感謝你,它像一個魅力。 – Bronzato 2012-02-03 08:35:51