HTML Line Break Tag

Whenever you use the <br/> element, anything following it starts from the next line. This tag is an example of an empty element, where you do not need opening and closing tags, as there is nothing to go in between them.

The <br/> tag has a space between the characters br and the forward slash. If you omit this space, older browsers will have trouble rendering the line break, while if you miss the forward slash character and just use <br> it is not valid in XHTML.

Example,

<!DOCTYPE html> 
<html> 
<head> 
<title>Line Break Example</title> 
</head> 
<body> 
<p>Hello Sir<br /> 
You delivered your assignment on time.<br /> 
Thanks<br /> 
Mahnaz</p> 
</body> 
</html> 

Why are Line Break Tag needed?

The HTML Line Break Tag ( <br> ) is used to start text on a new line without creating a new paragraph. In HTML, pressing “Enter” or adding extra spaces in the code doesn’t affect how text appears in the browser it will display everything on a single line. To fix this, the <br> tag tells the browser to break the line and continue the next content from a new line. It is an empty (self-closing) tag, meaning it doesn’t need an ending tag.

The line break tag is especially useful when you want to display text line by line within the same paragraph, such as in addresses, poems, or form fields.

For example: <p>Hello!<br>Welcome to my website.</p>

this code will display “Welcome to my website” on the next line. Without the <br> tag, all sentences would appear on the same line, making the text difficult to read. Therefore, the <br> tag improves readability, structure, and user experience, which are important for both users and SEO optimization.

Leave a Comment