div+css实现彩色立体小球checkbox胶囊开关效果代码

代码语言:html

所属分类:表单美化

代码描述:div+css实现彩色立体小球checkbox胶囊开关效果代码

代码标签: div css 彩色 立体 小球 checkbox 胶囊 开关

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

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  

  
  
  
<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  outline: 1px solid transparent;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 100vh;
  font-size: 2em;
}

.toggle-wrapper {
  display: inline-block;
  position: relative;
  border-radius: 3.125em;
  overflow: hidden;
}

.toggle-checkbox {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.toggle-container {
  di.........完整代码请登录后点击上方下载按钮下载查看

网友评论0