引导程序4自定义控件没有光标指针



<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="customSwitch1">
<label class="custom-control-label" for="customSwitch1">Toggle this switch element</label>
</div>

为什么自定义控件没有光标指针?我尝试style="游标:指针";或者通过无工作应用我的类光标指针

将这些行添加到您的css中:

.custom-switch .custom-control-label::before { cursor: pointer; }
.custom-switch .custom-control-label::after { cursor: pointer; }
.custom-switch .custom-control-input:disabled ~ .custom-control-label::before { cursor: not-allowed; }
.custom-switch .custom-control-input:disabled ~ .custom-control-label::after { cursor: not-allowed; }

最新更新