[英]Using chosen.js, how would I add images to the dropdown items?
使用selected.js,我如何将图像添加到下拉列表项?
通过在所选列表项上设置background-image
:
.chzn-results li {
background: url('path/to/img.png') no-repeat 3px center;
padding-left: 12px;
}
相应地调整像素数。
为了完成约瑟夫(我无法在他的回答中添加注释),该类自未知版本发生了变化:这是v1.0.0中正确的css:
li.active-result {
background: url('path/to/img.png') no-repeat 3px center;
text-indent:2em;
}
谢谢约瑟夫!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.