小编use*_*759的帖子

如何覆盖TextBoxFor字段的CSS?

在Site.css中有以下类:

input[type="textbox"].TextBoxAsLabel {
     background:#f2f3f3  !IMPORTANT;
}
Run Code Online (Sandbox Code Playgroud)

想要覆盖Edit.cshtml中TextBoxFor字段的默认背景

@Html.TextBoxFor(model => model.ClientNumber, new {@readonly = "readonly", @class = "TextBoxAsLabel"})
Run Code Online (Sandbox Code Playgroud)

它仍然使用默认的白色背景.我应该改变什么?

html css asp.net-mvc html.textbox html.textboxfor

1
推荐指数
1
解决办法
5753
查看次数

标签 统计

asp.net-mvc ×1

css ×1

html ×1

html.textbox ×1

html.textboxfor ×1