want to make underline invisible when @Html.ActionLink() in MVC5

时间:2016-04-07 10:34:18

标签: asp.net asp.net-mvc-5

I am using "@Html.ActionLink()" and used "text-decoration:none" in it. But still the link is showing underline for it.

Can anybody suggest solution for it to remove the underline.

Thanks, Yuoraj

1 个答案:

答案 0 :(得分:0)

You can do it inline like this:

@Html.ActionLink(<your params>, new { style="text-decoration:none"})

but really you should be using a css file and a class:

@Html.ActionLink(<your params>, new { @class="myclass"})

where myclass looks like

a.myclass {
text-decoration: none;
}

UPDATE:

a.hprLnkmastercls {
    text-decoration: none;
}

And if you don't want it underlined on hover

a.hprLnkmastercls:hover {
    text-decoration: none;
}

In your .cshtml

@Html.ActionLink("Process", "Home" "WebsiteHome", new {}, new { @class = "hprLnkmastercls" })

will render as:

<a class="hprLnkmastercls" href="/WebsiteHome/Home">Process</a>