zoukankan      html  css  js  c++  java
  • CSS Flex 实现 Alignment Shifting Wrapping

    实现效果:

    1、用 float 实现

    .html:

    <h3 class="title float-title">
      <span class="title-main">Main Title Here</span>
      <span class="title-note">This subtitle is floated.</span>
    </h3>
    

    .css:

    .title {
      border-bottom: 1px solid #ccc;
      margin: 40px auto;
    }
    .title-note {
      font-size: 60%;
      color: #999;
    }
    
    .float-title {
      .title-note {
        float: right;
        position: relative;
        top: 12px;
      }
    }
    

    2、用 flex 实现

    .html:

    <h3 class="title flex-title">
      <span class="title-main">Main Title Here</span>
      <span class="title-note">This is a good look, right here.</span>
    </h3>
    

    .css:

    .title {
      border-bottom: 1px solid #ccc;
      margin: 40px auto;
    }
    .title-note {
      font-size: 60%;
      color: #999;
    }
    
    .flex-title {
      display: flex;
      align-items: flex-end;
      flex-wrap: wrap;
      .title-main {
        flex-grow: 1;
      }
    }
    
  • 相关阅读:
    数据对象映射模式
    策略模式
    适配模式
    注册模式
    单例模式
    工厂模式
    PHP魔法方法的使用
    【转】通过 ulimit 改善系统性能
    HDMI相关知识
    中国三种3G网络频段
  • 原文地址:https://www.cnblogs.com/Leophen/p/15112368.html
Copyright © 2011-2022 走看看