Html.ActionLink()图像背景mvc

时间:2012-09-05 09:39:25

标签: asp.net-mvc-3 image html.actionlink

如何为Html.ActionLink()设置图像背景?

我的代码:

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

1 个答案:

答案 0 :(得分: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;
}