Set textarea width to 100% in bootstrap modal

前端 未结 7 1101
夕颜
夕颜 2020-12-08 18:31

Was trying all possible ways, but never succeeded:

    
7条回答
  •  不知归路
    2020-12-08 18:35

    I am new to .NET/MVC programming, but my understanding is that the Site.css file (under the Content folder in MVC) is a site-level override for Bootstrap CSS, allowing you to override bootstrap native settings in a portable and non-destructive manner (e.g. you can easily save and reapply your site.css changes when updating Bootstrap on your system.)

    In Bootstrap 3.0.0, Site.css has the following style setting:

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

    Other blogs have suggested that this 280px width was added in haste near a release date, in a desire to make the UI look better than it does with 100% width input. Fortunately it was placed in a "visible" location in the site file so you would notice it.

    Simply change the width setting, either for all three input types, or pull out textarea and give it its own setting if you want to leave the others alone.

提交回复
热议问题