Comments, Line Break and Horizontal Rule

In this section, we will discuss about commenting, line break and horizontal rule in HTML. These three are important part of HTML.

Comments are added to remember the part you have just programmed. It is better to put a comment for every part of the program. This is necessary if the code becomes large. The comment can be added as

<!--
START OF COMMENT
You can write anything between these.
This won't get rendered
END OF COMMENT
-->

Line Break <br>

HTML ignores white space. So, even if you try pressing return (Enter Key), you won’t get extra line. To add extra space you need to use Line Break <br>.

<h3>Many      Paragraphs</h3>
    
    
<p>HTML ignores white     spaces.</p>
output of the above program
output of the above program

Now, if you add br tags, as shown below

<h3>Many      Paragraphs</h3>
<br>
<br>
<br>
<br>
<p>HTML ignores white     spaces.</p>

The output of the program is shown below as

program after using br tags

Horizontal Rule <hr>

Horizontal rule is used to put a line in the web page. We can do it using hr tag.

The code shows below

<h3>Horizontal Rule</h3>
<hr>

<p>Text below horizontal rule</p>
horizontal rule example
output of the above program

The line on the webpage. You can use CSS to modify the line. You can change color, make it small or large depending on requirement.

Leave a Reply