css实现亮色暗色主题切换按钮开关点击效果代码

代码语言:html

所属分类:其他

代码描述:css实现亮色暗色主题切换按钮开关点击效果代码

代码标签: css 亮色 暗色 主题 切换 按钮 开关 点击

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

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

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

  
  
<style>
@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap");
body {
  display: grid;
  place-items: center;
  height: 100vh;
  width: 100vw;
  background-color: #fff;
  transition: all 1s;
  font-family: 'Poppins';
  overflow: hidden;
}
.holder {
  height: 100px;
  width: 150px;
  display: grid;
  place-items: center;
  position: relative;
}
.holder .switch {
  width: 0;
  height: 0;
  display: grid;
  place-items: center;
  position: absolute;
}
.holder .switch::after {
  content: '';
  width: 120px;
  height: 40px;
  background-color: #aaa;
  position: absolute;
  z-index: 1;
  border-ra.........完整代码请登录后点击上方下载按钮下载查看

网友评论0