CSS不适用于html.dropdownlist.please告诉我如何应用CSS。在我的下拉列表中加载了许多临时实体。为了减小尺寸,我使用下面的css。
<span id="filterByApplication"><%= Html.DropDownList("filterByApplicationName", new SelectList(Model.Applications, "Id", "Name", Model.SelectedApplication.Name), "ALL", new { @class = "drop-menu" })%></span>
CSS:
.drop-menu
{
max-height:200px;
overflow:auto;
position:relative;
text-align: left;
background: #fff;
border: 1px solid #f6f0e4;
box-sizing: border-box;
}
.drop-menu li
{
position:relative;
}