BR Not Working in Firefox or Chrome? Here's Why
In this article
If the HTML <br> tag appears to do nothing in Firefox or Chrome, the cause is almost always in the markup or the CSS around it, not in the browser. Both browsers render a plain <br> as a single line break, so if you see no break, one of these is true: the tag is malformed or escaped, a CSS rule is overriding its display, or the content around it is being laid out in a way that collapses the break. The fix is to validate the tag, check the computed style on the element, and make sure the surrounding container allows the line break to take effect. This guide walks through the checks in the order that finds the problem fastest.
What You'll Need
- A page open in Firefox or Chrome where the
<br>is not producing a visible break. - Access to the page source or your code editor so you can inspect the exact markup.
- The browser's built-in developer tools (press F12, or right-click the page and choose Inspect).
- A basic understanding of HTML and CSS selectors helps but is not required for the first few steps.
Step-by-Step
- Confirm the tag is really a
<br>and not escaped text. In the page source, look for<br>or a literal<br>inside a text node. If the tag is escaped, the browser prints it as text instead of treating it as markup. Fix the source so the tag is written as<br>and not as an entity or inside a code block that escapes it. - Check for a closing slash or stray attribute.
<br>and<br />both work in Firefox and Chrome. A tag like<br></br>is invalid and can behave unpredictably. Remove any closing tag and any attributes you did not intend. - Look at the element in DevTools. Right-click the line where the break should appear and choose Inspect. In the Elements panel, confirm the
<br>is present as its own element and not swallowed by a parent that hasdisplay: noneor is hidden. If the element is missing from the DOM, the markup never reached the browser as a tag. - Check the computed display value. With the
<br>selected, open the Computed tab in DevTools and look atdisplay. A normal<br>computes toinlineand forces a line break. If a CSS rule setsdisplay: noneordisplay: blockonbr, the break is removed or behaves differently. Search your stylesheet for abrselector and remove or override the rule. - Inspect the parent's white-space setting. If a parent element has
white-space: nowrap, line breaks are suppressed and<br>may not produce the visual break you expect. Change the parent towhite-space: normalor remove the rule, then reload. - Check for generated content or pseudo-elements. A rule like
br::after { content: ""; }or a reset that setsbr { content: none; }can interfere. In DevTools, expand the<br>element and look for::beforeor::afterentries. Remove any such rule that targetsbr. - Verify the surrounding container is not collapsing the break. Flex and grid containers treat children differently. A
<br>inside a flex container may not create a visual break because flex items are laid out along an axis. If the container hasdisplay: flexordisplay: grid, either move the<br>outside that container or switch the container back todisplay: blockfor the section that needs the break. - Test in a minimal page. Create a blank HTML file with just two lines of text separated by
<br>and no CSS. Open it in both Firefox and Chrome. If the break appears there, the problem is in your page's CSS or markup, not the browser. Add your stylesheet back in stages to find the rule that breaks it. - Clear the cache and hard reload. Both browsers cache CSS aggressively. Press Ctrl+F5 (Windows) or Cmd+Shift+R (Mac) to force a fresh load. If the break appears after a hard reload, an old stylesheet was being served.
- Validate the HTML. Run the page through the W3C Markup Validation Service. Unclosed tags earlier in the document can cause the browser to reparent the
<br>or drop it. Fix any structural errors the validator reports and reload.
Common Mistakes
- Writing
<br>in a template or CMS field that escapes HTML, so the browser shows the tag as text. - Using
<br>to create spacing between block elements. Margins and padding are the correct tool;<br>is for line breaks inside a block of text. - Assuming a
<br>will work inside a flex container. It often will not, because flex layout ignores inline line-break behavior. - Forgetting that
white-space: preandwhite-space: pre-wrapalready preserve newlines, so an extra<br>can look like it does nothing when the source already contains a newline character. - Leaving a global CSS reset that sets
br { display: none; }from an old template and never noticing it.
Tips
- Use the Elements panel's search (Ctrl+F while DevTools is focused) to find every
brselector in your stylesheets quickly. - If you need a visual gap, use
marginon the surrounding elements instead of stacking multiple<br>tags. - Keep a minimal test page handy. It separates browser behavior from page-specific CSS in seconds.
- When editing a CMS, check whether the editor has a "source" or "HTML" view. Visual editors sometimes convert line breaks into entities.
Troubleshooting
If the break still does not appear after the steps above, work through these checks in order. First, confirm the page is not being served from a service worker or cache: open DevTools, go to the Application tab, and unregister any service worker for the site, then hard reload. Second, disable all browser extensions temporarily; an extension that rewrites page styles can suppress breaks. Third, test in a private window with extensions disabled to rule out profile-level interference. Fourth, compare Firefox and Chrome side by side on the same minimal page. If both fail, the markup is the problem; if only one fails, check that browser's settings for minimum font size or page zoom, which can make a single break hard to see. Finally, if the <br> is inside a table cell or a button, remember that some elements have default styling that affects line breaks; inspect the computed style on the parent as well as the tag itself.
Frequently Asked Questions
Why does <br> show as text instead of breaking the line?
The tag is being escaped, usually by a CMS, template engine, or a code block. The browser receives <br> and prints it literally. Fix the source so the tag is written unescaped.
Does <br> work inside a flex container?
Usually not as a visual line break. Flex containers lay out children along an axis, so the <br> does not force a new line the way it does in normal block flow. Move the break outside the flex container or use a block layout for that section.
Can CSS hide a <br> tag?
Yes. A rule such as br { display: none; } removes the break. Check the Computed tab in DevTools with the <br> selected to see whether a stylesheet is overriding its display.
Why does the break appear in Chrome but not Firefox?
Both browsers follow the same HTML and CSS specifications for <br>, so a difference usually comes from cached CSS, an extension, or a browser setting such as minimum font size. Test the same minimal page in both to isolate it.
Is <br/> valid in HTML5?
Yes. <br> and <br /> are both accepted. The self-closing slash is optional and has no effect on rendering.
Should I use <br> for spacing between paragraphs?
No. Use separate paragraph elements and CSS margins. <br> is intended for line breaks within a block of text, such as in an address or a poem.