相关疑难解决方法(0)

如何使用CSS设置复选框的样式?

我正在尝试使用以下方式设置复选框的样式:

<input type="checkbox" style="border:2px dotted #00f;display:block;background:#ff0000;" />
Run Code Online (Sandbox Code Playgroud)

但风格并未适用.该复选框仍显示其默认样式.我如何给它指定的样式?

html css checkbox

788
推荐指数
21
解决办法
158万
查看次数

更改Bootstrap 4复选框背景颜色

我想知道如何在这个给定的例子中更改Bootstraps 4复选框背景颜色.

非常感谢!

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css" integrity="sha384-Zug+QiDoJOrZ5t4lssLdxGhVrurbmBWopoEl+M6BdEfwnCJZtKxi1KgxUyJq13dy" crossorigin="anonymous">  

<style>  
.custom-control-label::before,   
.custom-control-label::after {  
top: .8rem;  
width: 1.25rem;  
height: 1.25rem;  
}  
</style>  


<div class="custom-control form-control-lg custom-checkbox">  
    <input type="checkbox" class="custom-control-input" id="customCheck1">  
    <label class="custom-control-label" for="customCheck1">Check this custom checkbox</label>  
</div>  
Run Code Online (Sandbox Code Playgroud)

html css bootstrap-4

13
推荐指数
1
解决办法
2万
查看次数

标签 统计

css ×2

html ×2

bootstrap-4 ×1

checkbox ×1