aluckdog
2023-01-06 11:03:13
已經給出了如何隱藏 bootstrap 4 自定義選擇字段右側的雙箭頭的答案,如此處所示。生成的選擇框仍將右側的文本隱藏在現在不透明的箭頭后面。我希望能夠使用與左側一樣多的右側空間來顯示專為移動設備設計的顯示器。換句話說,可以進行哪些額外的更改以使文本在選擇框的最右側可見。您可以通過調整屏幕寬度來查看問題。.custom-select{background-image: none !important;}<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"/><div class="form-group"> <div class="col-8"> <div class="input-group"> <select class="custom-select"> <option>end of text string will hide behind opaque double arrow around here</option> <option>2</option> </select> </div> </div></div>
1 回答

哆啦的時光機
TA貢獻1779條經驗 獲得超6個贊
這是一個填充問題。使用 'padding-right' 減少空白。
.custom-select{
background-image: none !important;
padding-right:5px !important;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"/>
<div class="form-group">
<div class="col-8">
<div class="input-group">
<select class="custom-select">
<option>end of text string will hide behind opaque double arrow around here</option>
<option>2</option>
</select>
</div>
</div>
</div>
注意:5px 只是一個示例,您可能希望確保左右填充匹配。
添加回答
舉報
0/150
提交
取消