利用flex关于边线自适应(利用flex)

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>

    <style>
      .box {
        display: flex;
         80%;
        align-items: center;

        margin: 0 auto;
      }

      .line {
        border-bottom: 1px solid blue;
        flex: 1;
       
      }

      .text {
        padding: 0 12px;
        font-weight: 700;
        font-size: 14px;
      }
    </style>
  </head>
  <body>
    <div class="box">
      <div class="line"></div>
      <div class="text">优惠信息</div>
      <div class="line"></div>
    </div>
  </body>
</html>

关于flex:1详解;https://blog.csdn.net/qq_40138556/article/details/103967529

原文地址:https://www.cnblogs.com/fsg6/p/14354811.html