HTML Rules and Comments

Horizontal Rules

Horizontal rules give you a way to separate sections of your document visually. That way, you give readers a clean, consistent, visual indication that one portion of your document has ended and another portion has begun. Horizontal rules effectively set off small sections of text, delimit document headers and footers, and provide extra visual punch to headings within your document.

The <hr> tag
The <hr> tag tells the browser to insert a horizontal rule across the display window. With HTML, it has no end tag. Example :

<html>
<head>
<title>
HTML Rules
</title>
</head>
<body>
<p> this page will demonstrate rules</p>
<hr>
<p> paragraph 2</p>
<hr>
<p> paragraph 3</p>
</body>
</html>

Output :

HTML Comments

Comments can be inserted in the HTML code to make it more readable and understandable. Comments are ignored by the browser and are not displayed, as demonstrated in Following :

<html>
<head>
<title>HTML Commments</title>
</head>
<body>
<p> paragraph 1</p>
<!--This is a comment line and will not be diaplayed to output-->
<p> paragraph 2</p>
</body>
</html>

Output :