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>
广告