纯css实现手风琴效果

代码语言:html

所属分类:选项卡

代码描述:纯css实现手风琴效果

代码标签: 手风琴 效果

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


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link type="text/css" rel="stylesheet" href="http://repo.bfw.wiki/bfwrepo/css/reset.min.css">
<style>
*, *:before, *:after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: roboto, helvetica, arial, san-serif;
  color: #666;
  background: #e0e0e0;
  display: -webkit-box;
  display: flex;
  -webkit-box-pack: center;
          justify-content: center;
  -webkit-box-align: center;
          align-items: center;
  height: inherit;
}

.hide {
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  padding: 0;
  position: absolute;
  width: 1px;
}

.accordion {
  background: #fff;
  width: 400px;
  border: 1px solid #e0e0e0;
}

.accordion-item {
  position: relative;
  width: 100%;
  border-bottom: 1px solid #e0e0e0;
}
.accordion-item:last-child {
  border-bottom: none;
}

.accordion-label {
  padding: 20px 0 20px 30px;
  width: 100%;
  display: block;
  font-size: 18px;
}
.accordion-label:hover {
  cursor: pointer;
}
.accordion-label:before {
  content: '';
  position: absolute;
  height: 5px;
  width: 5px;
  top: 22px;
  left: 12px;
  display: inline-block;
  border-left: 5px solid #999;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
input[type=checkbox]:checked ~ .accordion-label:before {
  -webkit-transform: rotate(90deg);
          transform: rotate(90deg);
}

.accordion-child {
  margin: 0;
  overflow: hidden;
  -webkit-t.........完整代码请登录后点击上方下载按钮下载查看

网友评论0