HTML <multicol>标记用于创建多列文本,并允许您控制列的大小和数量。<multicol>标记可以包含任何其他HTML内容,与<div>标记非常相似。<multicol>标记内的所有内容均按常规内容显示,只是Netscape 4将内容分成多列而不是仅一列。
注-仅Netscape 3和更高版本支持此标记。
以下是属性-
属性 | 值 | 描述 |
---|---|---|
科尔斯 | 数 | 指定用于文本显示的文本列数。浏览器尝试使元素均匀地流过各列,以使各列的高度大致相同。除非存在WIDTH属性,否则将调整列宽以填充可用宽度。 |
排水沟 | 数 | 指定每列之间的距离(以像素为单位)。 |
宽度 | 数 | 指定每列的宽度(以像素为单位)。所有列的宽度相同。如果不存在此属性,则根据装订线宽度和列数来计算其值。 |
您可以尝试以下代码为文本流添加多列布局-
<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>