0
textarea控件的寬度未設置。它爲其他控件設置。有人能告訴我爲什麼心不是寬度申請文本區域寬度不適用於文本區域MVC
例如
設置邊框固體用於COL-MD-6
<div class="form-group">
@Html.LabelFor(model => model.ProjectName, htmlAttributes: new { @class = "control-label col-md-5" })
<div class="col-md-6">
@Html.EditorFor(model => model.ProjectName, new { htmlAttributes = new { @class = "form-control", style = "width:100%" } })
@Html.ValidationMessageFor(model => model.ProjectName, "", new { @class = "text-danger" })
</div>
</div>
<div class="clearfix"></div>
<div class="form-group">
@Html.LabelFor(model => model.ProjectSummary, htmlAttributes: new { @class = "control-label col-md-5" })
<div class="col-md-6">
@Html.TextAreaFor(model => model.ProjectSummary, new { htmlAttributes = new { @class = "form-control", rows = "3", style = "max-width:100%" } })
@Html.ValidationMessageFor(model => model.ProjectSummary, "", new { @class = "text-danger" })
</div>
</div>
在html中textareas你不需要的寬度,但列設置它的寬度... – Kathara
如果我刪除寬度,我沒有看到任何區別 – Tom
textarea而不是「style ='width:100% ;'「將需要屬性」columns = 100「,就像您用於行一樣。問題是找到你需要的寬度... – Kathara