0

如何将以下样式添加到下面的列表框,

@Html.ListBoxFor(m => m.AvailableProducts, new MultiSelectList(Model.AvailableProducts, "Id", "Name", Model.AvailableSelected),
                         new Dictionary<string, object> { { "data-bind", "options:availableProducts, selectedOptions:availableSelected, optionsText:'Name'" } })

CSS

div.selectbox-wrapper ul {
list-style-type:none;
margin:0px;
padding:0px;
}
div.selectbox-wrapper ul li.selected { 
background-color: #EAF2FB;
}
div.selectbox-wrapper ul li.current { 
background-color: #CDD8E4;
}
div.selectbox-wrapper ul li {
list-style-type:none;
display:block;
margin:0;
padding:2px;
cursor:pointer;
}
4

1 回答 1

0

使用 jQuery 插件将<select>元素更改为<div>带有<ul>'s 和<li>'s 的元素。

示例在这里:是否可以设置选择框的样式?

于 2012-08-25T15:22:42.573 回答