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.


HTML Image

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


You can try running this code snippet on our Online HTML Editor to view the output.



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.

Next Chapter Chapter 5 - HTML Text Styles and Formatting

Follow Me on Social Media

Advertisement
FREE Sales CRM Software

Fully customizable CRM Software for Freelancers and Small Businesses

Signup for Free

Sign up for DigitalOcean Cloud

Get FREE $200 credits, deploy your hobby projects for Free

DigitalOcean Referral Badge
Sign up for Hostinger Cloud or VPS plans and get upto 20% Discount