css美化radio单选按钮实现列表单选效果代码
代码语言:html
所属分类:表单美化
代码描述:css美化radio单选按钮实现列表单选效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { background: #222; color: #fff; overflow: hidden; height: 100%; min-height: 100vh; } body * { box-sizing: border-box; } input.rad__li { appearance: none; width: 100%; height: 100%; position: absolute; top: 0px; left: 0px; z-index: 11; } input.rad__li:after, input.rad__li:before { content: ""; display: block; width: 26px; height: 26px; position: absolute; left: 20px; top: 50%; transform: translateY(-65%); border-radius: 40px; border: solid 2px #444; } input.rad__li:after { width: 66px; height: 66px; top: 50%; transform: translateY(-50%); left: 4px; border: none; } input.rad__li.rad-off { display: none; } ol { margin: 0px; padding: 0px; max-width: 500px; margin: 40px auto; display: flex; position: relative; flex-direction: column; transform: scale(0.98); } ol:hover { cursor: pointer; } ol:after { position: absolute; content: ""; height: 60px; width: 398px; left: 0px; top: 40%; border: solid 2px #64f6e7; mix-blend-mode: screen; background: #022622; opacity: 0; border-radius: 12px; z-index: -1; display: block; position: absolute; transition: top 0.3s ease-out, transform 0.3s ease; transition-delay: 0.2s; pointer-events: none; } ol:after * { transform-style: preserve3d; cursor: pointer !important; } ol:hover:after { pointer-events: none !important; } ol > li { margin: 0px; padding: 0px; color: blue; display: block; height: calc($h + 6px); z-index: 1; padding-bottom: 6px; perspective: 500px; list-style: none; } ol > li > a { display: flex; text-decoration: none; height: 60px; width: 400px; border: solid 2px #999; border-radius: 12px; flex-direction: row; justify-items: center; justify-content: center; align-items: center; color: #ccc; font-family: helvetica; font-size: 26px; } ol > li:hover:not(:has(a > input.rad-on:checked)) { cursor: pointer; height: calc(var($h) + 12px); padding-bottom: 10px; } ol > li:hover:not(:has(a > input.rad-on:checked)) > a { cursor: pointer; z-index: 9999; border-color: #088679; transform: scale(1.02) translateZ(30px); transition: transform 0.2s ease, border-color 0.25s ease; } ol > li:hover:not(:has(a > input.rad-on:checked)) > a input.rad__li { height: 105%; } ol > li:hover:not(:has(a > input.rad-on:checke.........完整代码请登录后点击上方下载按钮下载查看
网友评论0