css美化checkbox滑竿效果代码
代码语言:html
所属分类:表单美化
代码描述:css美化checkbox滑竿效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <style> body { background: #5B5D8E; color: #D5D6E2; font-family: "Microsoft YaHei","Segoe UI", "Lucida Grande", Helvetica, Arial,sans-serif; } .switch-box { display: block; margin-top: 24px; } .switch-box .switch-box-slider { position: relative; display: inline-block; height: 8px; width: 32px; background: #d5d5d5; border-radius: 8px; cursor: pointer; -webkit-transition: all 0.2s ease; transition: all 0.2s ease; } .switch-box .switch-box-slider:after { position: absolute; left: -8px; top: -8px; display: block; width: 24px; height: 24px; border-radius: 50%; background: #eeeeee; box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.2); content: ''; -webkit-transition: all 0.2s ease; transition: all 0.2s ease; } .switch-box .switch-box-input { display: none; } .switch-box .switch-box-input ~ .switch-box-label { margin-left: 8px; } .switch-box .switch-box-input:checked ~ .switch-box-slider:after { left: 16px; } .switch-box .switch-box-input:disabled ~ .switch-box-slider { background: #e2e2e2; cursor: default; } .switch-box .switch-box-input:disabled ~ .switch-box-slider:after { background: #d5d5d5; } .switch-box.is-primary .switch-box-input:checked:not(:disabled) ~ .switch-box-slider { background: #28e1bd; } .switch-box.is-primary .switch-box-input:checked:not(:disabled) ~ .switch-box-slider:after { background: #1abc9c; } .switch-box.is-info .switch-box-input:checked:not(:disabled) ~ .switch-box-slider { background: #5faee3; } .switch-box.is-info .switch-box-input:checked:not(:disabled) ~ .switch-box-slider:after { background: #3498db; } .switch-box.is-success .switch-box-input:checked:not(:disabled) ~ .switch-box-slider { background: #54d98c; } .switch-box.is-success .switch-box-input:checked:not(:disabled) ~ .switch-box-slider:after { background: #2ecc71; } .switch-box.is-danger .switch-box-input:checked:not(:disabled) ~ .switch-box-slider { background: #ed7669; } .switch-box.is-danger .switch-box-input:checked:not(:disabled) ~ .switch-box-slider:after { background: #e74c3c; } .switch-box.is-warning .switch-box-input:checked:not(:disabled) ~ .switch-box-slider { background: #eb9950; } .switch-box.is-war.........完整代码请登录后点击上方下载按钮下载查看
网友评论0