在ASP.NET MVC3中如何移除下拉列表的箭头符号

3

我想在@Html.DropDownList中隐藏向下箭头符号。如何覆盖默认的下拉列表样式。

请参见下面的图像。

enter image description here

2个回答

7
您可以使用CSS为下拉菜单设置自定义外观:
.customDropDown { -webkit-appearance: none; -moz-appearance: none; 
// add background image what you like
}

将此类添加到您的下拉菜单:
@Html.DropDownList("DropDownID", String.Empty, new {@class="customDropDown "} )

4

您可以覆盖默认的本地CSS样式,但仅支持Webkit浏览器。

.dropDown{
webkit-appearance:none
//and change style whatever you want
}

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接