在 question here 之后,我试图将选择器的刻度线移动到选项文本的左侧。
这是网站上的示例:
我试图像这样覆盖 css:
.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a span.check-mark {
position: relative;
}
将其更改为相对
位置,但没有成功。
提前致谢。
更新
official website 上有一个例子:
<select class="selectpicker show-tick">
<option>Mustard</option>
<option>Ketchup</option>
<option>Relish</option>
</select>
更新a 2
这是我的 bootstrap-selecter css 文件,如下所示:
.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a span.check-mark {
position: relative;
display: inline-block;
right: 15px;
/*margin-top: 5px;*/
left:2px;
}
.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text {
margin-right: 34px;
}
最佳答案
在您的 CSS 中更新以下内容:
.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a span.check-mark{
position: absolute;
display: inline-block;
left: 5px; //changed from right:15
margin-top: 5px;
}
请看下图:
一切顺利。
关于javascript - css bootstrap select 将显示刻度标记移动到下拉菜单中文本的左侧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41571413/