You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can set a margin on <br> elements themselves to increase the spacing between the lines of text in the block, but this is a bad practice — you should use the line-height property that was designed for that purpose.
Which is odd because not even IE11 seems to do this. Assuming I'm not missing anything, we should probably change Firefox and specify the behavior of other browsers somewhere (where should rendering of the <br> element live? html? Ideally it should be less magical...).
Is there any case where <br> respects margins in other browsers?
The text was updated successfully, but these errors were encountered:
As discussed in the links above, the same is true about <wbr>: Firefox lets it have margins, other browsers don't. There's kind of a use case for allowing that, but that use case is better served by https://drafts.csswg.org/css-text-4/#word-boundaries.
TLDR: Somebody reported an interesting issue in their site, which happened to do with differences across browsers in how
<br>
applies (or doesn't) margin: https://bugzilla.mozilla.org/show_bug.cgi?id=1621387I don't think the rendering of
<br>
is very well specified other than "it introduces a forced line-break" and such... should it honor margin?Gecko does in:
data:text/html,<p>Foo<br style="margin: 200px"></p>
It seems to be long-standing behavior, and something that caught my eye is that MDN says this is something that you can do:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/br:
Which is odd because not even IE11 seems to do this. Assuming I'm not missing anything, we should probably change Firefox and specify the behavior of other browsers somewhere (where should rendering of the
<br>
element live? html? Ideally it should be less magical...).Is there any case where
<br>
respects margins in other browsers?The text was updated successfully, but these errors were encountered: