Bootstrap 4自定义控件没有光标指针

    <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 =“ cursor:pointer”或不进行任何操作来应用类的指针

esh2007 回答:Bootstrap 4自定义控件没有光标指针

将这些行添加到您的 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; }
本文链接:https://www.f2er.com/3153559.html

大家都在问