CSS 中设定列的速记属性


使用 columns 属性可以设定 CSS 的列。你可以尝试运行以下代码来实现 columns 属性

示例

实时演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         .demo {
            column-rule-color: gray;
            columns: 100px 4;
            column-rule-style: dashed;
         }
      </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 日

116 次浏览

开启你的 职业之旅

通过完成课程获得认证

开始
广告
© . All rights reserved.