什麼是 HTML 頁面中的水平規則?


<hr> 標記定義了在HTML頁面中的一箇中斷,或者用於使用水平線分隔 HTML 頁面中的內容,並通常顯示為一條水平規則線。

<hr> 標記定義了在 HTML 頁面中使用橫線的斷點。<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.