我想在我的視圖中設置一個特定文本框的寬度。不管是什麼我已經試過,在的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