Table of contents

HTML <br> Tag

What is HTML <br> Tag?

The HTML br tag is used to insert a line break in text. It is a self-closing tag that forces the text following it to start on a new line. The br tag does not add extra spacing; it simply breaks the line where it appears.

This tag is important when you need to display text content on multiple lines without starting a new paragraph. It is commonly used inside paragraphs, addresses, poems, and any text where you want precise control over line breaks.

The HTML br tag is very simple but useful for formatting text in a clean and readable way.

Syntax of the HTML <br> Tag

plaintext
<br>

The br tag is self-closing and does not require an ending tag. It can be used anywhere inside text content where a new line is needed.

Examples of HTML <br> Tag

Example 1: Basic HTML Line Break

plaintext
<!DOCTYPE html>
<html lang="en">
<body>

<p>Welcome to Scholar247.<br>Learn HTML, CSS, and JavaScript easily!</p>

</body>
</html>

In this example, the text “Learn HTML, CSS, and JavaScript easily!” starts on a new line because of the br tag. It helps keep the text visually separated without using another paragraph tag.

Example 2: Using Multiple Line Breaks

plaintext
<!DOCTYPE html>
<html lang="en">
<body>

<h2>Address Example - Scholar247</h2>
<p>Scholar247 Office<br>123 Learning Street<br>Web City, 2025</p>
</body>
</html>

This example uses multiple br tags to create an address format. Each br tag adds a new line, making the text display like a real-world address layout.

Attributes of the HTML <br> Tag

The HTML br tag does not support any attributes.
It is a simple line break tag that only controls the placement of text on a new line.

Best Practices for HTML <br> Tag

• Use the br tag only for minor line breaks within text, not for large spacing.
• Avoid using multiple br tags for layout or spacing; use CSS margin or padding instead.
• Keep text structured, use paragraphs (<p>) for separate ideas.
• Use the br tag inside poetry, addresses, or inline content where a manual break is necessary.
• Always ensure your page remains readable even if the line breaks are removed.

FAQs About the HTML <br> Tag

Q1: What is the purpose of the HTML br tag?

The br tag is used to create a single line break in text without starting a new paragraph.

Q2: Is the br tag self-closing?

Yes, the HTML br tag is self-closing. It does not require a closing tag.

Q3: Can I use multiple br tags for spacing?

While you can, it’s not recommended. For spacing between elements, use CSS properties like margin or padding instead.

Q4: Does the br tag affect SEO?

No, the br tag itself doesn’t affect SEO. However, using it properly helps keep your text structured and readable, which indirectly improves user experience.

Q5: What is the difference between <br> and <p>?

The br tag only breaks a single line, while the p tag defines an entire paragraph block. Use <p> for longer text sections and <br> for short line breaks within text.

HTML

Related Articles