幽灵checkbox切换效果

代码语言:html

所属分类:表单美化

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


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

<style>
body {
  width: 100%;
  height: 100%;
  background: black;
}

#boo {
  color: white;
  margin-bottom: 12px;
}

#boo.hide {
  opacity: 0;
}

.switch-container {
  width: 100%;
  height: 100vh;
  display:flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.switch {
  position: relative;
  display: inline-block;
  width: 100px;
  height: 25px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: grey;
  transition: .4s;
}

input:checked + .slider {
  backgr.........完整代码请登录后点击上方下载按钮下载查看

网友评论0