CSS align-content 属性 space-between 值的用法


使用值 space-betweenalign-content属性可在弹性线之间添加空格。

你可以尝试运行以下代码来实现space-between

示例

实时演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         .mycontainer {
            display: flex;
            height: 200px;
            background-color: red;
            align-content: space-between;
            flex-wrap: wrap;
         }
         .mycontainer > div {
            background-color: yellow;
            text-align: center;
            line-height: 60px;
            font-size: 30px;
            width: 100px;
            margin: 5px;
         }
      </style>
   </head>
   <body>
      <h1>Queue</h1>
      <div class = "mycontainer">
         <div>Q1</div>
         <div>Q2</div>
         <div>Q3</div>
         <div>Q4</div>
         <div>Q5</div>
         <div>Q6</div>
         <div>Q7</div>
         <div>Q8</div>
      </div>
   </body>
</html>

更新于: 2020 年 6 月 24 日

105 次浏览

开启你的职业生涯

完成课程,获取认证

开始
广告
© . All rights reserved.