Search code examples
cssasp.net-mvc-3asp.net-mvc-views

Add CSS class to Html.ActionLink


I want to style a link in my page and am using Html.ActionLink to create the link. The problem is I don't know how to style the resulting link. How do I add a CSS class to the Html.ActionLink in order to style it?


Solution

  • Html.ActionLink("Link Name", 
                    "ActionName",
                    "ControllerName",
                    null,
                    new { @class = "myCssClass" }
                    )