--- title: column-span slug: Web/CSS/column-span translation_of: Web/CSS/column-span ---
CSS 属性column-span
的值被设置为all
时,可以让一个元素跨越所有的列。一个跨越多列的元素被称为spanning element。
{{cssinfo}}
Formal syntax: {{csssyntax("column-span")}}
column-span: none; column-span: all; column-span: inherit;
none
all
下例中的 h2 元素横跨 article 元素中的各列
<article> <h2>My Very Special Columns</h2> <p>This is a bunch of text split into three columns using the CSS `columns` property. The text is equally distributed over the columns.</p> </article>
article { columns: 3; } h2 { column-span: all; }
{{EmbedLiveSample('Example', 'auto', 120)}}
Specification | Status | Comment |
---|---|---|
{{ SpecName('CSS3 Multicol', '#column-span0', 'column-width') }} | {{ Spec2('CSS3 Multicol') }} |
{{ CompatibilityTable() }}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{ CompatVersionUnknown() }}{{ property_prefix('-webkit') }} | {{ CompatNo() }} | 10 | 11.1+ | {{ CompatVersionUnknown() }}{{ property_prefix('-webkit') }} |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | {{ CompatVersionUnknown() }}{{ property_prefix('-webkit') }} | {{ CompatVersionUnknown() }}{{ property_prefix('-webkit') }} | {{ CompatNo() }} | {{ CompatUnknown() }} | 11.1+ | {{ CompatVersionUnknown() }}{{ property_prefix('-webkit') }} |