HTML 網頁中的水平線是什麼?


<hr> 標籤定義了一個 HTML 頁面中的分隔符,或用於透過一條水平線分隔 HTML 頁面中的內容,通常顯示為一條水平規則。

<hr> 標籤使用一條水平線定義了一個分隔符。 <hr> 標籤是一個空元素。它僅有一個開始標籤,即 <hr>

語法

以下為 <hr> 標籤的語法。

<hr>...

示例

以下為示例程式,其中使用了 <hr> 標籤在網頁上分隔內容。

<!DOCTYPE html> <html> <body> <h3>LOK SABHA</h3> <p>Lok Sabha is composed of representatives of the people chosen by direct election.<br> The maximum strength of the House of the Constitution is 552, <br> which is made up by election of upto 530 members to represent the States,<br> upto 20 members to represent the Union Territories and not more than two members of the<br> Anglo-Indian Community to be nominated by the Hon'ble President.</p> <hr> <p> After coming into effect of The Constitution Act, 2019<br> the provision of special representation <br>of the Anglo-Indian community in the House of the People by nomination has not been extended further.</p> <hr> <p>The total elective membership is distributed among the States in such a way<br> that the ratio between the number of seats allotted to each State and the population of the State is,<br>so far as practicable, the same for all States.</p> <hr> </body> </html>

我們還可以向 hr 標籤新增樣式。

示例

以下為向 <hr> 標籤新增樣式的示例程式。

<!DOCTYPE html> <html> <body> <h3>LOK SABHA</h3> <p>Lok Sabha is composed of representatives of the people chosen by direct election. <br> The maximum strength of the House of the Constitution is 552,<br> which is made up by election of upto 530 members to represent the States, <br> upto 20 members to represent the Union Territories and not more than two members of the<br> Anglo-Indian Community to be nominated by the Hon'ble President.</p> <hr style="height:10px;"> </body> </html>

示例

以下為向 <hr> 標籤新增樣式的示例程式。

<!DOCTYPE html> <html> <body> <h3>LOK SABHA</h3> <p>Lok Sabha is composed of representatives of the people chosen by direct election. <br> The maximum strength of the House of the Constitution is 552,<br> which is made up by election of upto 530 members to represent the States,<br> upto 20 members to represent the Union Territories and not more than two members of the<br> Anglo-Indian Community to be nominated by the Hon'ble President.</p> <hr style="height:8px;background-color:gray"> </body> </html>

更新時間: 2023 年 11 月 21 日

1K+ 次瀏覽

開啟您的 職業生涯

透過完成課程獲得認證

開始
廣告
© . All rights reserved.