div+css实现选项卡立体倾斜单选效果代码

代码语言:html

所属分类:布局界面

代码描述:div+css实现选项卡立体倾斜单选效果代码

代码标签: div css 选项卡 立体 倾斜 单选

下面为部分代码预览,完整代码请点击下载或在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: black;
     }
     .container {
         margin: 100px;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.pane {
  outline: 2px solid #00ff6a;
  box-shadow: 0 0 10px #00ff6a77, inset 0 0 10px #00ff6a77;
  height: 1cm;
  width: 4.5cm;
  border-radius: 5px;
  position: relative;
  overflow: hidden;
  transition: 0.7s ease;
}

.input {
  display: none;
}

.label {
  height: 1cm;
  width: 1.5cm;
  float: left;
  font-weight: 600;
  letter-spacing: -1px;
  font-size: 14px;
  padding: 0px;
  position: relative;
  z-index: 1;
  color: #00ff6a;
  text-align: center;
  padding-top: 10px;
}

.selection {
  display: none;
  position: absolute;
  height: 1cm;
  width: calc(4.5cm / 3);
  z-index: 0;
  left: 0;
  top: 0;
  box-shadow: 0 0 10px #00ff6a77;
  transition: .15s ease;
}

.label:has(input:checked) {
  color: #212121;
}

.pane:has(.label:nth-child(1):hover) {
  transform: rotateY(-30deg);
}

.pane:has(.label:nth-child(3):hover) {
  transform: rotateY(35deg);
}

.label:has(input:checked) ~ .selection {
  bac.........完整代码请登录后点击上方下载按钮下载查看

网友评论0