Line breaks (<br>)

0
9χλμ.

The <br> tag is used to insert a single line break in your HTML content. It's an empty element, meaning it doesn't have a closing tag.

Basic Usage

HTML
<p>This is a paragraph with a <br> line break.</p>

Example with Multiple Line Breaks

HTML
<p>This is a poem:<br>
  Line 1<br>
  Line 2<br>
  Line 3</p>

Important Points

  • Inline element: Unlike paragraphs, <br> is an inline element, meaning it doesn't start on a new line and doesn't take up the full width available.
  • Limited use: While <br> can be useful in specific cases, it's generally recommended to use paragraphs for better structure and readability.
  • Accessibility: Excessive use of <br> can make content difficult to read for users with visual impairments.

When to Use <br>

  • Poetry or addresses: Where preserving specific line breaks is important.
  • Short, non-paragraph content: For very short lines of text that don't warrant a full paragraph.

Example with Headings, Paragraphs, and Line Breaks

HTML
<!DOCTYPE html>
<html>
<head>
  <title>Headings, Paragraphs, and Line Breaks</title>
</head>
<body>

<h1>This is a Main Heading</h1>

<p>This is a paragraph with a <br> line break.</p>

<h2>Subheading</h2>

<p>This is a poem:<br>
  Line 1<br>
  Line 2</p>

</body>
</html>
Αναζήτηση
Κατηγορίες
Διαβάζω περισσότερα
Technology
Reasons why we should all learn Ms Excel
Learning Microsoft Excel is beneficial for several reasons:   1. **Data Management**:...
από Mpatswe Francis 2024-07-16 06:35:02 0 11χλμ.
Εκπαίδευση
UACE WAKISSHA FOODS AND NUTRITION 2024
UACE WAKISSHA FOODS AND NUTRITION 2024
από Landus Mumbere Expedito 2024-08-10 10:19:35 0 10χλμ.
Physics
UCE PHYSICS PAPER 1 WAKATA MOCKS 2024
UCE PHYSICS PAPER 1 WAKATA MOCKS 2024
από Landus Mumbere Expedito 2024-08-10 07:19:10 0 14χλμ.
Technology
Creating a login form using HTML and CSS
Creating a login form using HTML and CSS is a fundamental skill in web development. Here's a...
από Tebtalks Access 2025-01-21 01:24:55 0 12χλμ.
Computer Programming
Range and Nested Loops
Range Function (range()) The range() function is a built-in function in Python used to generate...
από Python for Everybody - Full University Python Course Code 2024-07-16 21:52:05 0 9χλμ.
Talksphare https://talksphare.com