答案 0 :(得分:2)
如果您只想删除箭头,则应强制为custom-select
类应用背景样式,因为这些箭头设置为背景。请尝试以下代码作为参考。
.custom-select{
background: none !important;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<div class="form-group">
<label for="date">Date</label>
<div class"row">
<div class="col-5">
<input.....>
</div>
<div class="col-7">
<div class="input-group">
<select class="custom-select">
<option.....>
</select>
</div>
</div>
</div>
</div>
希望这有帮助
答案 1 :(得分:0)
将css更改为:
.custom-select{
background:#fff;
}
答案 2 :(得分:0)
将此添加到您的CSS文件中:
.custom-select {
background: none;
}
答案 3 :(得分:0)
如上所述,最好使用background-image:无。我添加了字段,以便您可以看到效果。
请确保您调整填充以减少分配给下拉箭头的空白,否则文本将被裁剪为看似空白的空间。
.custom-select{
background-image: none !important;
padding-left: 10px !important;
padding-right: 10px !important;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<div class="form-group">
<label for="date">Date</label>
<div class"row">
<div class="col-3">
<input type="text" placeholder="some text">
</div>
<div class="col-10">
<div class="input-group">
<select class="custom-select">
<option>Sample text</option>
<option>Second text</option>
</select>
</div>
</div>
</div>
</div>