div+css实现下拉闸刀checkbox开关效果代码
代码语言:html
所属分类:布局界面
代码描述:div+css实现下拉闸刀checkbox开关效果代码码
代码标签: div css 下拉 闸刀 checkbox 开关
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum=1.0,minimum=1.0,user-scalable=0" /> <style> body{ margin:100px; background: #212121; text-align:center; } .switch { font-size: 17px; position: relative; display: inline-block; width: 1.2em; height: 3.3em; } /* Hide default HTML checkbox */ .switch .chk { opacity: 0; width: 0; height: 0; } /* The slider */ .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 5px; } .slider:before { position: absolute; content: ""; height: .5em; width: 2.4em; border-radius: 5px; left: -0.6em; top: 0.2em; background-color: white; box-shadow: 0 6px 7px rgba(0,0,0,0.3); transition: .4s; } .slider:before, .slider:after { content: ""; display: block; } .slider:after { background: linear-gradient(transparent 50%, rgba(255, 255, 255, 0.15) 0) 0 50% / 50% 100%, repeating.........完整代码请登录后点击上方下载按钮下载查看
网友评论0