This content originally appeared on Envato Tuts+ Tutorials and was authored by Andy Leverenz
The <br>
element represents a line break. <br>
elements must be used only for line breaks that are part of the content, as in poems or addresses.
Example
Syntax
1 |
<p>John Doe <br> created a new account yesterday.</p> |
Result
Browser Support
The <br>
tag is supported in all modern browsers but must be used where phrasing content is expected. Read more on caniuse.com.
Attributes
The <br>
tag supports Global Attributes in HTML. Global Attributes are common to all HTML elements and can be used on all of them (though they may not have much of an effect on some of them).
Content
The <br>
tag is a void element, which means it has no content model.
Gimme a Break
Is it <br>
, <br/>
or <br />
? There’s often confusion on which way to write the br
tag in today’s HTML5 standards.
<br>
is sufficient, and modern browsers are forgiving enough to convert other variants to that one. Remember that a br
tag is a self-closing tag so it doesn’t surround nor describe any content.
Learn More
This content originally appeared on Envato Tuts+ Tutorials and was authored by Andy Leverenz
Andy Leverenz | Sciencx (2023-03-20T19:53:57+00:00) HTML Element: br. Retrieved from https://www.scien.cx/2023/03/20/html-element-br/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.