div+css布局实现立体质感radio播放按键按下切换单选效果代码

代码语言:html

所属分类:布局界面

代码描述:div+css布局实现立体质感radio播放按键按下切换单选效果代码

代码标签: div css 布局 立体 质感 radio 播放 按键 按下 切换 单选

下面为部分代码预览,完整代码请点击下载或在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{
         background: #212121;
         margin: 200px;
     }

.radio-input {
    width: 260px;
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: black;
  padding: 6px;
  border-radius: 8px;
  overflow: hidden;
  height: 94px;
}

.radio-input input {
  display: none;
}

.radio-input .label {
  width: 70px;
  height: 80px;
  background-color: #2a2a2a;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8px 6px;
  border-top: 1px solid #383838;
  transition: all 0.1s linear;
  position: relative;
  z-index: 2;
}

.label .back-side {
  position: absolute;
  top: -10px;
  left: 0px;
  background-color: #2a2a2a;
  border-radius: 4px 4px 2px 2px;
  width: 100%;
  height: 14px;
  box-shadow:
    inset 0 5px 3px 1px rgba(0, 0, 0, 0.5),
    inset 0px -5px 2px 0px rgba(56, 163, 224, 0.1);
  transform: perspective(300px) rotateX(50deg);
  z-index: 1;
  opacity: 0;
  transition: all 0.1s linear;
}

.label:has(input[type="radio"]:checked) .back-side {
  opacity: 1;
}

.label:has(input[type="radio"]:checked) {
  transform: perspective(200px) rotateX(-18deg);
  transform-origin: 50% 40%;
  box-shadow: inset 0px -20px 15px 0px rgba(0, 0, 0, 0.5);
  border-top: 1px solid #2589c362;
  margin-top: 6px;
  border-radius: 0 0 4px 4px;
}

.label .text {
  color: black;
  font-size: 15px;
  line-height: 12px;
  padding: 0px;
  font-weight: 800;
  text-transform: uppercase;
  transitio.........完整代码请登录后点击上方下载按钮下载查看

网友评论0