2. columns 设置列宽和列数

column-count 内容分列

column-count: number|auto

  • number:列的个数

  • auto:根据column-with自动适配

html

<div class="newspaper">
“当我年轻的时候,我梦想改变这个世界;当我成熟以后,我发现我不能够改变这个世界,我将目光缩短了些.
</div>

css

.newspaper
{
    /* 分成3列 */
    column-count:3;
}

column-fill 列填充方式

column-fill: balance|auto;

  • balance:列长短平衡

  • auto:列顺序填充,他们长度可能不同

html

css

column-gap 列之间的差距

column-gap: length|normal

  • length:指定的长度

  • normal:1em

html

css

column-rule 指定列之间的规则:宽度,样式和颜色

column-rule: column-rule-width column-rule-style column-rule-color

  • -width:间隔宽度

  • -style:间隔样式

  • -color:间隔的颜色

html

css

column-rule-color 列之间间隔线颜色

column-rule-style 列之间间隔线样式

column-rule-width 列之间间隔线宽度

值:thin|medium|thick|length;

  • thin:细线

  • medium:中等

  • thick:粗

  • length:指定宽度

column-span 指定元素跨级列

column-span:1|all

  • 1:跨越1列

  • all:跨越所有列

html

css

column-width 列宽度

html

css

columns 指定列的宽度和数量

columns: column-width column-count;

html

css

Last updated

Was this helpful?