How can I change cols of textarea in twitter-bootstrap?

前端 未结 7 693
我在风中等你
我在风中等你 2021-02-01 00:23

If I change the value of :rows, it works. But it stays at the default cols whatever value I set with \':cols =>\'. Column width won\'t change.

I viewed the html source a

相关标签:
7条回答
  • 2021-02-01 01:14

    Another option is to split off the textarea in the Site.css as follows:

    /* Set width on the form input elements since they're 100% wide by default */
    
    input,
    select {
    
      max-width: 280px;
    }
    
    textarea {
    
      /*max-width: 280px;*/
      max-width: 500px;
      width: 280px;
      height: 200px;
    }
    

    also (in my MVC 5) add ref to textarea:

    @Html.TextAreaFor(model => ................... @class = "form-control", @id="textarea"............
    

    It worked for me

    0 讨论(0)
提交回复
热议问题