【问题标题】:Html.ActionLink() image background mvcHtml.ActionLink() 图片背景 mvc
【发布时间】:2012-09-05 09:39:24
【问题描述】:

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

我的代码:

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

【问题讨论】:

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


【解决方案1】:

你需要设置@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;
}

【讨论】:

    猜你喜欢
    • 2010-10-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-11
    • 2013-08-16
    • 1970-01-01
    • 2019-03-24
    • 1970-01-01
    相关资源
    最近更新 更多