纯css手风琴展示效果 hover

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

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .accordion {
          width: 1254px;
          height: 850px;
          margin: 100px auto;
          overflow: hidden;
          }
		  .block {
		    width: 873px;
		    float: right;
		    height: 580px;
		    background-color: skyblue;
		    overflow: hidden;
		  }
		  .title {
		    width: 873px;
		    font-weight: 600;
		    color: #1c60da;
		    line-height: 30px;
		    font-size: 22px;
		    padding: 35px 0 28px 0;
		  }
          .accordion div {
            margin-right: 2px;
            float: right;
            transition: all 1s;
          }
		  .list{
			 width: 105px;
			 height: 580px;
			background-color: red;  
			border: 1px solid black;
			}
          .blockS {
            width: 0;
            height: 580px;
            background-color: #00BFC8;
            overflow: hidden;
          }
        
          .hblock:hover .blockS {
            width: 873px;
          }
          .right:hover + .block { //+表示hover 的后一个元素发生变化
            width: 0px;
            overflow: hidden;
          }
    </style>
</head>
<body>
    <div class="accordion">
        <div class="right">
          <div class="hblock">
            <div class="list"></div>
            <div class="blockS">
            </div>
          </div>
          <div class="hblock">
            <div class="list"></div>
            <div class="blockS">
            </div>
          </div>
          <div class="hblock">
            <div class="list"></div>
            <div class="blockS">
            </div>
          </div>
        </div>
    
        <div class="block">
          <div class="title">css手风琴展示效果</div>
          <div alt="" />
        </div>
      </div>
</body>
</html>

你可能感兴趣的:(css,css3,html)