css实现黑色checkbox开关按钮切换效果代码

代码语言:html

所属分类:布局界面

代码描述:css实现黑色checkbox开关按钮切换效果代码

代码标签: css 黑色 checkbox 开关 按钮 切换

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">

<style>
    body {
  margin:0;
  padding:0;
  background:#151515;
}

.center {
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%, -50%);
}

input[type="checkbox"] {
  margin:10px;
  position:relative;
  width:120px;
  height:40px;
  -webkit-appearance: none;
  background: linear-gradient(0deg, #333, #000);
  outline: none;
  border-radius: 20px;
  box-shadow: 0 0 0 4px #353535, 0 0 0 5px #3e3e3e, inset 0 0 10px rgba(0,0,0,1);
}

input:checked[type="checkbox"]:nth-of-type(1) {
  background: linear-gradient(0deg, #e67e22, #f39c12);
  box-shadow: 0 0 0 4px #353535, 0 0 0 5px #3e3e3e, inset 0 0 10px rgba(0,0,0,1);
}

input:checked[type="checkbox"]:nth-of-type(2) {
  background: linear-gradient(0deg, #70a1ff, #1e90ff);
  box-shadow: 0 0 0 4px #353535, 0 0 0 5px #3e3e3e, inset 0 0 10px rgba(0,0,0,1);
}

input[type="checkbox"]:before {
  content:'';
  position:absolute;
  top:.........完整代码请登录后点击上方下载按钮下载查看

网友评论0