I have text that I'd like to display on two lines. Adding a <br>
tag accomplishes that:
<!-- Browser displays two lines of text, as intended -->
<a>Text unit 1<br>
Text unit 2 </a>
I would like to apply styling to 'Text unit 2'. No matter what tag I apply to the text, the browser ignores the <br>
as soon as I introduce it:
<!-- Browser displays one line of text, not as intended -->
<a>Text unit 1<br>
<literally any HTML tag>Text unit 2</tag></a>
I've tried <span>
, <p>
, <div>
, <em>
, and <strong>
tags. All of them display as a single line instead of two lines as soon as the tags are introduced.
How do I force the <br>
tag to implement a line break?
Edit: Firefox 85 and Chromium 87.0
not working in Firefox](https://stackoverflow.com/questions/10500551/br-not-working-in-firefox) – iamdhavalparmar Mar 02 '21 at 18:14
` element itself becomes a flex element and will be laid out according to flex rules. You'd end up with a flex layout that looks like this: `| text 1 |
| text 2 |` with everything laid out in a row. – ray Mar 02 '21 at 18:52
` only becomes a flex element if there's a second element present. Otherwise, it's recognized as a regular line break. I'll play around with solutions, thanks. – Darien Marks Mar 02 '21 at 18:59