我有一个表单的<input type='date' class='form-control'>
日期输入。因为我使用bootstrap 5中的表单控件,所以日期选择器被设置为默认的白色,与表单相同。
我已经搜索了多种方法来更改日期选择器的颜色,但仍然一无所获。
代码段:https://codepen.io/TCMF/pen/YzLrBYE
::-webkit-calendar-picker-indicator {
filter: invert(1);
}
<link href="https://bootswatch.com/5/cyborg/bootstrap.min.css" rel="stylesheet">
<div class="container form-group col-7">
<label for>Date: </label>
<input type="date" class="form-control" id="date" required name="date" >
</div>
尝试使用id
或class
选择器设置CSS。
#date {
background-color: #abcdef;
}
<link href="https://bootswatch.com/5/cyborg/bootstrap.min.css" rel="stylesheet">
<div class="container form-group col-7">
<label for>Date: </label>
<input type="date" class="form-control" id="date" required name="date" >
</div>