Asp.net
如何更改 html.DropDownListFor() 的寬度
我有一個關於設計的小問題
html.DropDownListFor()如何更改寬度
html.DropDownListFor()?例如通過 css。感謝您的回答
你有沒有嘗試過
Html.DropDownListFor( new {width:"100"})或者
Html.DropDownListFor( new {@class:"longDropdownList"})編輯
<style> .MakeWide { width: 200px; } </style> <%= Html.DropDownListFor(x => x.Name, new SelectList(new List<string>()), new { @class = "MakeWide" })%>
如果您使用的是 Bootstrap,它會在 site.css 中將最大寬度設置為 280 像素。
您可能不想更改它,以便為單個控制項集覆蓋它:
new { style = "max-width:100%:width:350px" }