使用 CSS 指定列之间的间距


使用 column-gap 属性设置列之间的间距。尝试运行以下代码实现 column-gap 属性,值为 50px

示例

在线演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         .demo {
            column-count: 4;
            column-gap: 50px;
         }
      </style>
   </head>
   <body>
      <div class = "demo">
         This is demo text. This is demo text. This is demo text. This is demo text.
         This is demo text. This is demo text. This is demo text. This is demo text.
         This is demo text. This is demo text. This is demo text. This is demo text.
         This is demo text. This is demo text. This is demo text. This is demo text.
         This is demo text. This is demo text. This is demo text. This is demo text.
         This is demo text. This is demo text. This is demo text. This is demo text.
         This is demo text. This is demo text. This is demo text. This is demo text.
      </div>
   </body>
</html>

更新于: 2020 年 6 月 24 日

134 次浏览

启动你的职业生涯

通过完成课程来获得认证

开始
广告
© . All rights reserved.