我一直在寻找如何更改所选项目的width
of@Html.DropDownList
没有任何成功。出于设计目的,我想将其设置为450px
,但似乎没有超出300
。这会是一个限制吗?
@Html.DropDownList("AddressID", null, htmlAttributes: new { style = "width:450px" })
Run Code Online (Sandbox Code Playgroud)
似乎new { style="width:450px" }
只改变了选项的宽度;不是选定的区域。在研究时,我发现了如何height
使用size
as in更改所选项目的new { size="20" }
。所以我尝试使用new { width = "450" }
但没有成功。Length
也不起作用。:(
我会很感激我能得到的任何帮助。谢谢!