div+css实现自适应响应式选项卡效果代码

代码语言:html

所属分类:选项卡

代码描述:div+css实现自适应响应式选项卡效果代码,移动端就会变成手风琴式折叠面板。

代码标签: div css 自适应 响应式 选项卡

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">

  

<style>
/* Android 2.3 :checked fix */
@-webkit-keyframes fake {
  from {
    opacity: 1;
  }
  to {
    opacity: 1;
  }
}
@keyframes fake {
  from {
    opacity: 1;
  }
  to {
    opacity: 1;
  }
}
body {
  -webkit-animation: fake 1s infinite;
          animation: fake 1s infinite;
}

.worko-tabs {
  margin: 20px;
  width: 80%;
}
.worko-tabs .state {
  position: absolute;
  left: -10000px;
}
.worko-tabs .flex-tabs {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}
.worko-tabs .flex-tabs .tab {
  flex-grow: 1;
  max-height: 40px;
}
.worko-tabs .flex-tabs .panel {
  background-color: #fff;
  padding: 20px;
  min-height: 300px;
  display: none;
  width: 100%;
  flex-basis: auto;
}
.worko-tabs .tab {
  display: inline-block;
  padding: 10px;
  vertical-align: top;
  background-color: #eee;
  cursor: hand;
  cursor: pointer;
  border-left: 10px solid #ccc;
}
.worko-tabs .tab:hover {
  background-color: #fff;
}

#tab-one:checked ~ .tabs #tab-one-label,
#tab-two:checked ~ .tabs #tab-two-label,
#tab-three:checked ~ .tabs #tab-three-label,
#tab-four:checked ~ .tabs #tab-four-label {
  background-color: #fff;
  cursor: default;
  border-left-color: #69be28;
}

#tab-one:checked ~ .tabs #tab-one-panel,
#tab-two:checked ~ .tabs #tab-two-panel,
#tab-three:checked ~ .tabs #tab-three-panel,
#tab-four:checked ~ .tabs #tab-four-panel {.........完整代码请登录后点击上方下载按钮下载查看

网友评论0