zoukankan      html  css  js  c++  java
  • 【CSS】实现五点布局

    实现五点布局

    在这里插入图片描述

    <div class="box">
      <div class="column">
        <span class="pip"></span>
        <span class="pip"></span>
      </div>
      <div class="column">
        <span class="pip"></span>
      </div>
      <div class="column">
        <span class="pip"></span>
        <span class="pip"></span>
      </div>
    </div>
    
    /* 重点内容 */
    .box{
      display: flex;
      flex-direction: column;
    }
      
    .box .column {
      display: flex;
      justify-content: space-between;
    }
      
    .box .column:nth-of-type(2) {
      justify-content: center;
    }
    
    
    
    body {
      display: flex;
      align-items: center;
      justify-content: center;
      vertical-align: center;
      flex-wrap: wrap;
      align-content: center;
      font-family: 'Open Sans', sans-serif;
      
      background: linear-gradient(top, #222, #333);
    }
    
    .box {
      margin: 16px;
      padding: 4px;
      
      background-color: #e7e7e7;
      width: 104px;
      height: 104px;
      object-fit: contain;
      
      box-shadow:
        inset 0 5px white, 
        inset 0 -5px #bbb,
        inset 5px 0 #d7d7d7, 
        inset -5px 0 #d7d7d7;
      
      border-radius: 10%;
    }
    
    .pip {
      display: block;
      width: 24px;
      height: 24px;
      border-radius: 50%;
      margin: 4px;
    
      background-color: #333;
      box-shadow: inset 0 3px #111, inset 0 -3px #555;
    }
    
    
    
    • 或者换成row弹性,每个元素flex-wrap: wrap; align-content: space-between;,中间的元素align-content: center;
    /* 重点内容 */
        
        .box {
            display: flex;
            flex-direction: row;
        }
        
        .box .column {
            display: flex;
            flex-wrap: wrap;
            align-content: space-between;
        }
        
        .box .column:nth-of-type(2) {
            align-content: center;
        }
        
        body {
            display: flex;
            align-items: center;
            justify-content: center;
            align-content: center;
            background: linear-gradient(top, #222, #333);
        }
    
  • 相关阅读:
    HDU_2203_KMP入门
    HDU_1711_初识KMP算法
    过滤器基础
    HDU_1907_基础博弈nim游戏
    nim游戏解法(转)
    HDU_1517_博弈(巧妙规律)
    HDU_1850_nim游戏
    HDU_1847_基础博弈sg函数
    < 转>Java 反射机制浅析
    <转>单机版搭建Hadoop环境
  • 原文地址:https://www.cnblogs.com/SiriusZHT/p/14521323.html
Copyright © 2011-2022 走看看