2012-09-05 68 views
0

如何爲Html.ActionLink()設置圖像背景?Html.ActionLink()圖像背景mvc

我的代碼:

@Html.ActionLink("Home", "Index", "Home", new {@data_transition = "slide"}) 
+1

看這裏http://stackoverflow.com/questions/4896439/action-image-mvc3-razor –

+1

這在MVC3中很有用。謝謝! Home taia

回答

0

您需要設置@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; 
}