我想在我的视图中设置一个特定文本框的宽度。不管是什么我已经试过,在的site.css下面的代码优先:如何覆盖Html.TextBoxFor的输入[type =“text”]?
input[type="text"], input[type="password"]
{
// other properties
width: 200px;
}
我曾尝试:
@Html.TextBoxFor(model => model.Headline, new { style = "width: 400" })
和
@Html.TextBoxFor(model => model.Headline, new { @class = "wide" })
和
@Html.TextBoxFor(model => model.Headline, new { @id = "headline" })
但唯一重要的是输入[type =“text”]宽度。我不想改变全部的输入,只是这一个。
我没有在.wide和#headline的.css文件中设置宽度。
感谢。你的建议,以及我之前尝试过的所有内容,都可以工作,如果我在CSS文件中默认的“输入”设置之后放*。 – 2012-03-27 22:05:29