HTML <multicol> 标签用于创建多列文本,并允许您控制列的大小和数量。
<multicol> 标签可以包含任何其他 HTML 内容,就像 <div> 标签一样。<multicol> 标签中的所有内容都与传统内容一样显示,不同之处在于 Netscape 4 将内容放入多列中,而不仅仅是一列。
不再推荐使用此标记,因为它已被弃用,在 HTML5 中不受支持,而 Netscape 3 支持此标记。
例子
以下示例将在 Netscape 中创建一个三列布局。
<h1>Breaking News</h1>
<multicol cols = 3>
<p>State media said more than 2,000 soldiers, police and miners
closed the breach in the dike in Shandong province early Sunday and
installed pipes and five high-speed pumps, but gave no indication if
there were any signs of life.</p>
<p>The Huayuan Mining Co. mine flooded on Friday afternoon when the
Wen river burst a dike, sending water pouring into a shaft and trapping
172 miners, Xinhua and state television said.</p>
</multicol>
在运行上述代码时,它将生成一个输出,其中包含网页上显示的文本。
属性 | 值 | 描述 |
---|---|---|
cols | number | 指定文本显示的文本列数。浏览器尝试在列之间均匀地流动元素,以使每列的高度大致相同。除非存在 WIDTH 属性,否则将调整列宽以填充可用宽度。 |
gutter | number | 指定每列之间的距离(以像素为单位)。 |
width | number | 指定每列的宽度(以像素为单位)。所有列的宽度都相同。如果此属性不存在,则根据装订线宽度和列数计算其值。 |
标准属性
属性 | 描述 |
---|---|
class |
文档范围标识符 |
dir |
指定文本的方向 |
id |
文档范围标识符 |
style |
帮助包含内联 casecadubf 样式表。 |
lang |
设置语言代码。 |
xml:lang |
设置语言代码。 |