Line Breaks and Horizontal Rules


  • The <br> tag functions to create line breaks within text blocks.
  • The <br> tag functions without needing a closing tag.
  • The <br> tag serves the purpose of moving text to a new line while maintaining paragraph continuity.

html-line-breaks-and-horizontal-rules


Example

<p>
  This is line one.<br>
  This is line two.
</p> 

notepad

Avoid Overusing <br> for layout. Use CSS for spacing instead.


Horizontal Rule: <hr>

  • The <hr> tag creates a horizontal line (a visual divider).
  • Used to separate sections of content.
  • It is also an empty tag (no closing tag).

Example

<h2>Section One</h2>
<p>This is the first section of content.</p>

<hr>

<h2>Section Two</h2>
<p>This is the second section of content.</p> 

notepad
  • <br> - Inserts a line break
  • <hr> - Inserts a horizontal rule/line



OnlineTpoint is a website that is meant to offer basic knowledge, practice and learning materials. Though all the examples have been tested and verified, we cannot ensure the correctness or completeness of all the information on our website. All contents published on this website are subject to copyright and are owned by OnlineTpoint. By using this website, you agree that you have read and understood our Terms of Use, Cookie Policy and Privacy Policy.