这篇翻译不完整。请帮忙从英语翻译这篇文章。
概述
columns 是一个简写的CSS 属性,允许同时设置 column-width 和column-count 属性。
| 初始值 | as each of the properties of the shorthand:
|
|---|---|
| 适用元素 | non-replaced block elements (except table elements), table-cell or inline-block elements |
| 是否是继承属性 | 否 |
| 适用媒体 | visual |
| 计算值 | as each of the properties of the shorthand:
|
| 是否适用于 CSS 动画 | as each of the properties of the shorthand:
|
| 正规顺序 | order of appearance in the formal grammar of the values |
语法
Formal syntax: <'column-width'> || <'column-count'>
columns: 1em;/*column-width列的长度值*/ columns: 1;/*column-count列数*/ columns: auto; columns: 1 auto; columns: auto 12em; columns: auto auto;
取值
<'column-width'>- 是一个用来暗示渲染出的最优的列宽的
<length>(长度值)。但实际的长度值可能会更宽,用来填充剩余的可用空间;也可能更窄,如果可用宽度小于所定义的列宽。长度值必须为严格的正整数,否则此声明将会失效。 <'column-count'>- 是一个
<integer>(整数),且必须为正整数。用来将一整块内容分割成理想的个数的几列。如果column-width被设置为non-auto的值,它只是表示所允许的最大列数。
示例
.content-box {
border: 10px solid #000000;
columns:3;
}
规范
| 规范 | 标准 | 注释 |
|---|---|---|
| CSS Multi-column Layout Module columns |
Candidate Recommendation | Initial definition |