ActionLink with multiple classes in ASP.NET MVC3

老子叫甜甜 提交于 2019-12-07 08:34:13

问题


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:


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:



来源:https://stackoverflow.com/questions/8465133/actionlink-with-multiple-classes-in-asp-net-mvc3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!