ActionLink with multiple classes in ASP.NET MVC3

2019-05-06 04:27发布

I'm curious, is it possible to use multiple CSS classes on an ActionLink in MVC3 Razor syntax? The line below appears to load only the first class(btn) and skipps btn_c.

@Html.ActionLink("Administration", "Index", "Admin", null, new { @class = "btn btn_c" })

1条回答
Juvenile、少年°
2楼-- · 2019-05-06 04:43

I've just used your existing ActionLink with the following css:

.btn
{
    color: yellow;
}

.btn_c
{
    background-color: red;
}

And it successfully produced the following output:

LinkOutput

查看更多
登录 后发表回答