代码之家  ›  专栏  ›  技术社区  ›  Rutwick Gangurde

灵活布局-文本换行问题,具有2列布局

  •  0
  • Rutwick Gangurde  · 技术社区  · 6 年前

    |--标题————内容--|

    |--TLE————耳鼻喉科--|

    flex-wrap: no wrap

    display: flex; width: 100%; align-items: flex-start; justify-content: space-between;

    如何解决包装问题?

    https://jsfiddle.net/njcs30g9/7/ Child 2

    1 回复  |  直到 6 年前
        1
  •  2
  •   londongrammar    6 年前

    使用 flex-shrink: 0

    flex-shrink .

    .parent {
      display: flex;
      width: 100%;
      align-items: flex-start;
    }
    .child {
        flex-shrink: 0;
    }
    <div class='parent'>
      <div class='child'>
        <span class='child-l'>Child</span>
        <span class='child-r'>2</span>
      </div>
      
      <div class='content'>
        These are multiple lines of content that expand into 2 lines and breaks the UI.
      </div>
    </div>