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>
    

  • 相关阅读:
    验证码图片不刷新解决方法
    表单验证
    Thinkphp显示系统常量信息的方法(php的用法)
    原生sql语句执行
    Python中的模块(2)
    Python 正则表达式中级
    正则表达式 和 原生字符串 r
    collections模块
    时间模块
    random模块
  • 原文地址:https://www.cnblogs.com/yesyes/p/7260682.html
Copyright © 2011-2022 走看看