Skip to main content
HTML Validation

Stray start tag “br”.

About This HTML Issue

The <br> element is phrasing content, so it can only appear where phrasing content is expected — inside elements like <p>, <li>, <td>, <span>, and similar text-level containers. Elements such as <ul>, <ol>, <table>, <thead>, <tbody>, <tr>, <select>, and <dl> have restricted content models that only allow specific child elements. Placing a <br> directly inside any of these is invalid HTML.

Browsers may silently move or ignore a stray <br>, but the behavior is inconsistent. Screen readers and other assistive technologies depend on correct document structure to convey meaning. A <br> floating inside a list or table can produce unexpected reading order or layout differences across browsers.

Examples

<br> inside a list

The <ul> element only allows <li> (and <script>/<template>) as children.

<!-- Wrong -->
<ul>
  <br>
  <li>Item 1</li>
  <li>Item 2</li>
</ul>
<!-- Fixed -->
<ul>
  <li>Item 1</li>
  <li>Item 2</li>
</ul>

If a line break is needed, place it inside a <li> where phrasing content is allowed:

<ul>
  <li>123 Main St.<br>Suite 400</li>
</ul>

<br> inside a table

The <table> element only allows <caption>, <colgroup>, <thead>, <tbody>, <tfoot>, and <tr> as children.

<!-- Wrong -->
<table>
  <br>
  <tr>
    <td>A</td>
  </tr>
</table>
<!-- Fixed -->
<table>
  <tr>
    <td>A</td>
  </tr>
</table>

<br> used for spacing between blocks

A <br> placed between block-level elements like <div> is technically inside their parent (often <body> or another <div>), so it may not always trigger this specific error. But when it appears in a context that disallows phrasing content, the validator flags it. In either case, CSS margins are the correct way to add spacing between blocks.

<!-- Wrong -->
<div>Section A</div>
<br>
<div>Section B</div>
<!-- Fixed: use CSS margin instead -->
<div style="margin-bottom: 1rem;">Section A</div>
<div>Section B</div>

<br> outside <body>

A <br> placed between </head> and <body> is stray because only <head> and <body> are valid children of <html>.

<!-- Wrong -->
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Example</title>
</head>
<br>
<body>
  <p>Content here.</p>
</body>
</html>
<!-- Fixed -->
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Example</title>
</head>
<body>
  <p>Content here.</p>
</body>
</html>

If you see multiple "stray start tag br" errors in a single file, check the parent containers first. Fixing one misplaced parent element often resolves several related errors at once.

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
$7 / 7 days

Pro Trial

Full Pro access. Cancel anytime.

Start Pro Trial →

Join teams across 40+ countries