2012-02-03 82 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