Bootstrap复选框和单选按钮美化插件(推荐)
网络编程 2021-07-04 19:19www.168986.cn编程入门
这篇文章主要介绍了Bootstrap复选框和单选按钮美化插件的相关资料,非常不错,具有参考借鉴价值,需要的朋友可以参考下
需要引入awesome-bootstrap-checkbox.css、font-awesome.css以及font awesome对应的字体font文件,可在上面的网站上下载。
checkboxs的样式
radio的样式
radio样式
只要引入上面所说的文件之后,也可以自己定制样式,代码如下
.checkbox label::before { content: ""; display: inline-block; position: absolute; width: 20px; height: 20px; left: 0; margin-left: -20px; border: 1px solid #;<!--没选中时的边框颜色--> border-radius: 3px; background-color: #fff;<!--没选中时的颜色--> -webkit-transition: border 0.15s ease-in-out, color 0.15s ease-in-out; -o-transition: border 0.15s ease-in-out, color 0.15s ease-in-out; transition: border 0.15s ease-in-out, color 0.15s ease-in-out; } .checkbox label::after { display: inline-block; position: absolute; width: 16px; height: 16px; left: 0; : 0; margin-left: -19px;<!--可以改变“√”的位置--> padding-left: 3px;<!--可以改变“√”的位置--> padding-: 1px;<!--可以改变“√”的位置--> font-size: 13px;<!--选中后的中间打钩的字体大小(字体越大中间的勾越大越明显)--> color: #FAD500;<!--选中后的中间打钩的颜色--> } .checkbox input[type="checkbox"], .checkbox input[type="radio"] { opacity: 0; z-index: 1; } .checkbox input[type="checkbox"]:focus + label::before, .checkbox input[type="radio"]:focus + label::before { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; background-color: black; border-color: black; } .checkbox input[type="checkbox"]:checked + label::before, .checkbox input[type="radio"]:checked + label::before { background-color: black;<!--选中后的背景颜色--> border-color: black;<!--选中后的边框颜色--> } .checkbox input[type="checkbox"]:checked + label::after, .checkbox input[type="radio"]:checked + label::after { font-family: "FontAwesome"; content: "\f00c"; } .checkbox input[type="checkbox"]:disabled + label, .checkbox input[type="radio"]:disabled + label { opacity: 0.65; } .checkbox input[type="checkbox"]:disabled + label::before, .checkbox input[type="radio"]:disabled + label::before { background-color: #eeeeee; cursor: not-allowed; } .checkbox.checkbox-circle label::before { border-radius: 50%; <div> <div class="checkbox checkbox-circle"> <input id="radio1" class="styled" type="radio" name="radio"> <label for="radio1" class="font-bolder"> radio1 </label> </div> <div class="checkbox checkbox-circle"> <input id="radio2" class="styled" type="radio" name="radio"> <label for="radio2" class="font-bolder"> raido2 </label> </div> </div>
上面代码执行的效果
以上所述是长沙网络推广给大家介绍的Bootstrap复选框和单选按钮美化插件,希望对大家有所帮助,如果大家有任何疑问请给我留言,长沙网络推广会及时回复大家的。在此也非常感谢大家对狼蚁SEO网站的支持!
编程语言
- 宿迁百度关键词排名指南:实现精准营销的关键
- 四川SEO优化怎么做网络推广
- 立昂技术备案老域名收购:如何为您的业务赋能
- 安徽百度关键词seo贵不贵,一般需要多少钱
- 吉林百度快照排名怎么做电话营销
- 多伦新手做SEO怎么做
- 甘肃优化关键词排名推广怎么做论坛营销
- 沙雅SEO网站推广:提升您的在线可见性
- 四川SEO优化如何提升销售额和销售量
- 聂荣网站排名优化:提升网站可见性的全方位指
- 涞水SEO:提升地方企业在线可见性的策略
- 辽宁百度seo排名怎样做网站排名
- 临湘哪有关键词排名优化:提升网站可见度的关
- 黑龙江百度网站优化有没有优惠
- 凉城优化关键词排名推广:提升您的网络可见性
- 萝北整站优化:提升您网站流量和排名的全面指