The line break is used to decide where the text will break on a line or continue to the end of the window. It can be used to move the control to the next line. The tag is used to end a line without inserting a new paragraph. The has no closing tag.
Example of line break
The following text will appear in two different lines.
<p>this is sentence one. This is sentence two. </p>
this is sentence one. This is sentence two.
With BR tag
<p>this is sentence one. <br> This sentence two.</p>
This is sentence one. (Next sentence is going two next lines due to br tag)
This is sentence two.
Challenge for you:
Write HTML code that displays text in four lines using br tag.
Step 1: Open notepad and type the following code:
<html> <head> <title> WU Exercise</title> </head> <body> <p>I have three Friends: <br>Ali<br>Hamza<br>Numan</p> </body> </html>
Step 2: Save the file as “wuexcricese.html”
Step 3: Double click on the file. The web page will appear in the browser with the following result
hr tag is used to add the horizontal line in your paragraph or with any elements. Use this following code and see the result and decide what is the difference between hr and br tag.
<html> <head> <title> WU Exercise</title> </head> <body> <p>I have three Friends: <hr>Ali<hr>Hamza<hr>Numan</p> </body> </html>
The BR and HR tag has no important attribute and these both have no closing tag.
If you want to learn more about HTML then visit the official website: Visit
Visit the HTML tutorial list. And make strong your HTML concept. Click here. wuschools.com is always written about the HTML concept for the HTML lover. Ang writes about how HTML makes your life easy if you are a web site developer. We help you to continue your learning.