Reputation: 176
I use the following view code which I created in MVC5 and I want to change the button style to be like the forum buttons (e.g. ask question button in this stack forum,add button frame color etc),how should I do that? currently its just text that when you hoover it with the mouse you see line under it...
<p>
@Html.ActionLink("Create New Item", "Create")
</p>
Upvotes: 1
Views: 7215
Reputation: 1
Use this:
<button type="submit" class="btn btn-labeled btn-info" onclick="location.href='@Url.Action(" Details ", "Movies
",new { id = item.Id})'" data-toggle="modal tooltip" data-target="" title="Details">
<span class="btn-label">
<i class="glyphicon glyphicon-comment"></i>
</span>
Details
Upvotes: 0
Reputation: 62260
You just need css to style a button.
<p>
@Html.ActionLink("Create New Item", "Create",
null, htmlAttributes: new { @class = "mybtn"})
</p>
<style type="text/css">
a.mybtn {
background: #777;
color: #fff;
display: inline-block;
padding: 6px 12px 6px 12px;
text-decoration: none;
}
</style>
Upvotes: 3
Reputation: 14250
Use the overload
@Html.ActionLink("linktext", "action", "controller", routeValues: new { }, htmlAttributes: new { @class="" })
then supply a css class.
Upvotes: 2