zoukankan      html  css  js  c++  java
  • flexbox子盒子align-self属性

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
      <meta charset="UTF-8">
      <title>Document</title>
      <style>
      .flex-container {
        display: flex;
         700px;
        height: 400px;
        background-color: gray;
      }
    
      .flex-item {
        background-color: green;
         100px;
        height: 100px;
        margin: 5px;
      }
      /*align-self设置子盒子的排列方式,其属性值和父盒子的align-items的相同*/
    
      .flex-item:nth-child(1) {
        align-self: flex-start;
      }
    
      .flex-item:nth-child(2) {
        align-self: center;
      }
    
      .flex-item:nth-child(3) {
        align-self: flex-end;
      }
    	/*默认值*/
      .flex-item:nth-child(4) {
        height: auto;
        align-self: stretch;
      }
    	
    	/*基线对齐*/
      .flex-item:nth-child(5) {
        align-self: baseline;
      }
    
      .flex-item:nth-child(6) {
        font-size: 30px;
        align-self: baseline;
      }
      </style>
    </head>
    
    <body>
      <div class="flex-container">
        <div class="flex-item">flex item 1</div>
        <div class="flex-item">flex item 2</div>
        <div class="flex-item">flex item 3</div>
        <div class="flex-item">flex item 4</div>
        <div class="flex-item">baseline</div>
        <div class="flex-item">baseline</div>
      </div>
    </body>
    
    </html>
    

  • 相关阅读:
    requestAnimationFrame
    js来监控复制粘贴
    nodejs事件循环
    前端路由
    js基础查漏补缺(更新)
    http & https & http2.0
    进度条方案
    移动端适配方案
    性能优化之节流、防抖
    altium designer 里如何设置PCB默认字符默认大小(PCB丝印)
  • 原文地址:https://www.cnblogs.com/yesyes/p/7260682.html
Copyright © 2011-2022 走看看