【发布时间】:2012-09-04 20:59:13
【问题描述】:
使用 selected.js,如何将图像添加到下拉项?
【问题讨论】:
使用 selected.js,如何将图像添加到下拉项?
【问题讨论】:
通过在选择的列表项上设置background-image:
.chzn-results li {
background: url('path/to/img.png') no-repeat 3px center;
padding-left: 12px;
}
相应地调整像素数。
【讨论】:
background 而不是background-image。
为了完成 Joseph(我无法对他的回答添加评论),该课程自未知版本以来发生了变化: 这是 v1.0.0 中正确的 css:
li.active-result {
background: url('path/to/img.png') no-repeat 3px center;
text-indent:2em;
}
谢谢约瑟夫!
【讨论】: