Skip to main content

HTML Guide

Stray start tag “br”.

A stray <br> happens when the <br> element, which is phrasing content, is placed in contexts that only allow specific children. Common mistakes include putting <br> directly inside <ul>, <ol>, <table>, <tr>, or outside <body>, and inserting it between block-level siblings to add spacing instead of using CSS. The validator flags this because it violates the HTML content model.

This matters for standards compliance, predictable rendering, and accessibility. Screen readers and assistive tech rely on correct structure (lists made of li, tables built from tr/td, sections within body). Misplaced <br> can produce confusing reading orders and inconsistent layout across browsers.

How to fix:

  • Keep <br> only where phrasing content is allowed (typically inside text-flowing elements like p, span, li, td, caption).
  • For spacing between blocks, use CSS margins instead of <br>.
  • For lists, use proper li items; for tables, place text inside td/th; for forms, use grouping and CSS.
  • Ensure no <br> appears outside <body> or inside elements that have restricted content models (ul, ol, table, tr, thead, tbody, tfoot, colgroup, select, dl directly, etc.).
  • If a line break is purely presentational across viewports, consider CSS (display:block, white-space) instead of <br>.

Examples

Valid use inside phrasing content

<p>
  First line.<br>
  Second line.
</p>

Invalid: <br> directly inside a list (triggers the error)

<ul>
  <br>
  <li>Item 1</li>
  <li>Item 2</li>
</ul>

Fix: remove the stray <br>; use list items only

<ul>
  <li>Item 1</li>
  <li>Item 2</li>
</ul>

Invalid: <br> outside <body> (triggers the error)

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Stray br Tag Example</title>
</head>
<br>
<body>
  Content here.
</body>
</html>

Fix: move <br> inside the body (or use CSS if only spacing is needed)

<!DOCTYPE html>
<html lang="en">
<head>
  <title>No Stray br Tag</title>
</head>
<body>
  Content here.<br>
  New line in body.
</body>
</html>

Invalid: <br> as a child of <table> (triggers the error)

<table>
  <br>
  <tr>
    <td>A</td>
    <td>B</td>
  </tr>
</table>

Fix: use proper table rows and cells; place text inside cells

<table>
  <tr>
    <td>A</td>
    <td>B</td>
  </tr>
  <tr>
    <td>More A</td>
    <td>More B</td>
  </tr>
</table>

Invalid: using <br> for spacing between blocks (not allowed between siblings)

<div>Section A</div>
<br>
<div>Section B</div>

Fix: use CSS margins for spacing

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Spacing with CSS</title>
  <style>
    .block { margin-bottom: 1rem; }
  </style>
</head>
<body>
  <div class="block">Section A</div>
  <div>Section B</div>
</body>
</html>

Valid alternatives where a break is needed in phrasing context

<li>
  Address: 123 Main St.<br>
  Suite 400
</li>

Tips:

  • Use exactly <br> (no closing tag needed) and do not self-close as XML (<br />) unless your tooling requires it; both parse in HTML, but stick to HTML style for consistency.
  • If you see multiple “stray start tag ‘br’” errors, check parent containers: fixing the first invalid parent often resolves many subsequent errors.

Learn more:

Last reviewed: February 13, 2026

Was this guide helpful?

Related W3C validator issues