在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)
它仍然使用默认的白色背景.我应该改变什么?