js实现网页背景暗色和亮色开关切换。开关按钮是checkbox,用css样式美化input[type=checkbox]{ height: 0; width: 0; visibility: hidden; } label { cursor: pointer; text-indent: -9999px; width: 52px; height: 27px; background: grey; float: right; border-radius: 100px; position: relative; } label::after{ content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background-color: white; border-radius: 90px; transition: 0.3s; } input:checked + label { background-color: var(--color-headings); } input:checked + label::after { left: calc(100% - 5px); transform: translateX(-100%); } label:active:after { width: 45px; }
文件目录······
暂无数据
猜你喜欢
更多»
项目推荐
更多»
PDF电子书
更多»
Java多线程编程核心技术
(2)
Linux命令详解词典.pdf
(5)
深入Python3中文版
(0)
百度SEO一本通.pdf
(0)
mysql必知必会.pdf
(2)
疯狂JAVA讲义 pdf电子书
(3)
C# 图解教程pdf电子书
(3)
研磨设计模式 pdf电子书
(0)