How to change width of html.DropDownListFor()

前端 未结 3 1015
我在风中等你
我在风中等你 2021-02-20 03:02

I have small design question about

html.DropDownListFor() 

How can I change width of html.DropDownListFor() ?? For example by css.

3条回答
  •  独厮守ぢ
    2021-02-20 03:27

    @Html.DropDownListFor(x => x.Name, new SelectList(new List()), new {style="width:270px;"} );

    Will do the thing. Although better to use css class

提交回复
热议问题