0
如何爲Html.ActionLink()
設置圖像背景?Html.ActionLink()圖像背景mvc
我的代碼:
@Html.ActionLink("Home", "Index", "Home", new {@data_transition = "slide"})
如何爲Html.ActionLink()
設置圖像背景?Html.ActionLink()圖像背景mvc
我的代碼:
@Html.ActionLink("Home", "Index", "Home", new {@data_transition = "slide"})
您需要設置@class = "css-classname"
, 這樣的:
@Html.ActionLink("Home",
"Index",
"Home",
new {@data_transition = "slide"},
new {@class="css-class-name"})
和使用.css
.css-class-name{
background-image: your image;
}
看這裏http://stackoverflow.com/questions/4896439/action-image-mvc3-razor –
這在MVC3中很有用。謝謝! – taia