HTML Tutorial


Chapter 4 – HTML Line Breaks and Horizontal line

Welcome to the fourth chapter of HTML tutorial. In the previous tutorial, we learnt HTML Headings and Paragraphs. In this tutorial, we will discuss about Line breaks and Horizontal line in HTML.


Line Breaks

If you want to display a text in a new line without starting a new paragraph, you can use the line break using <br> tag.

An example of this tag in HTML code is shown below for reference.

<p>
Hello,<br>
Welcome to 123mylist.com
</p>

The output of the above code will be as shown below

Hello,
Welcome to 123mylist.com



Horizontal Line

Sometimes you may want to display a text in new line and in addition to that you want to display a visible separator. In such a case you can make use of horizontal line using the <hr> tag.

An example usage of horizontal line is given below for reference:

Hello, this is first line.
<hr>
Hello, this is second line.
                   

The output of this code will be as shown below

Hello, this is first line.
Hello, this is second line.

Here, you can notice that two lines have a line separator between them in order to distinguish two separate elements.

Hope you liked reading this tutorial, see you in next chapter to explore HTML in further details.

Content is copyrighted © www.123mylist.com