HTML - <multicol> 標籤



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 數字 指定文字顯示的文字列數。瀏覽器嘗試將元素均勻地分佈在各列中,以使每列的高度大致相同。除非存在 WIDTH 屬性,否則列寬將調整為填充可用寬度。
gutter 數字 以畫素為單位指定每列之間的距離。
width 數字 以畫素為單位指定每列的寬度。所有列的寬度都相同。如果此屬性不存在,則其值將根據列間距和列數計算得出。

標準屬性

序號 屬性 & 描述
1 class

文件範圍識別符號

2 dir

指定文字方向

3 id

文件範圍識別符號

4 style

幫助包含內聯樣式表。

5 lang

設定語言程式碼。

6 xml:lang

設定語言程式碼。

廣告