嗨,大家好,我想改變這個編輯器字段的高度和寬度我試着改變編輯器字段類,但它並沒有調整文本框本身的大小,而是改變了文本框周圍的空間,加入「新{}」,但沒有奏效請幫忙謝謝您的時間如何更改mvc中的編輯器字段4
<div class="editor-field">
@Html.EditorFor(model => model.HomeAddress)<br>
@Html.ValidationMessageFor(model => model.HomeAddress)
</div>
> legend {
font-size: 1.2em;
font-weight: bold;
}
textarea {
min-height: 75px;
}
.editor-label {
margin: 1em 0 0 0;
}
.editor-field {
margin: 0.5em 0 0 0;
height:10000px;
width:10000px;
}
可能重複的[MVC和EditorFor寬度](http://stackoverflow.com/questions/4720909/mvc-and-editorfor-width) – CodeCaster
請參見[重複](http://stackoverflow.com/questions/4720909/MVC和 - editorfor寬度)。 'EditorFor()'將呈現用戶指定或內置的編輯器模板。這不能保證是任何一個HTML元素。編輯器模板理論上可以不輸出任何內容,也可以輸出多個元素,所以不可能對其應用類或樣式。要做到這一點,你必須使用'TextBoxFor()',或者將'EditorFor()'包裝在你選擇的元素中,在這個元素中你通過CSS來設置所有的控件,或者創建你自己的包含所需CSS的編輯器模板。 – CodeCaster
他需要調整* editor-field *的CSS,所以這個問題很簡單。 – Robert