How can I change the size of a multi-line editor-field?

前端 未结 7 1895
予麋鹿
予麋鹿 2021-01-04 00:32

I\'m working on an MVC project using C#. Right now, I\'m trying to customize my views a little, and I\'d like to make the text boxes bigger.

I followed the suggesti

相关标签:
7条回答
  • 2021-01-04 00:47

    To adhere to a previously created view style, you can also do this:

    <div class="col-md-10 editor-multiline-field">
    
    0 讨论(0)
  • 2021-01-04 00:53

    If you are using mvc and bootstrap try this:

    @Html.TextAreaFor(model => model.Property, new { @class = "form-control", @rows = 5 })
    
    0 讨论(0)
  • 2021-01-04 00:58

    try

    @Html.TextAreaFor(model => model.Descricao, 5, 50, null)

    in View Page

    0 讨论(0)
  • 2021-01-04 01:03

    In MVC 5 you can use

        @Html.TextAreaFor(model => model.body, 5, 50,  new { @class = "form-control" } )
    

    Works nicely!

    0 讨论(0)
  • 2021-01-04 01:07

    You can also use @Html.TextArea ou TextAreaFor

    @Html.TextAreaFor(model => model.Text, new { cols = 25, @rows = 5 })
    
    0 讨论(0)
  • 2021-01-04 01:10

    I would do this with CSS:

    <div class="editor-multiline-field">
         @Html.EditorFor(model => model.Body)
         @Html.ValidationMessageFor(model => model.Body)
    </div>
    

    and then in your CSS file define the width and height to the desired values:

    .editor-multiline-field textarea {
        width: 300px;
        height: 200px;
    }
    
    0 讨论(0)
提交回复
热议问题