<br> tag is used to insert a line break within text content, such as in a paragraph or heading. It’s a self-closing tag, meaning it doesn’t require a closing tag. The
<br> tag is particularly useful when you want to create a new line without starting a new paragraph, like in a poem or an address.
Example 1: Inserting Single Line Breaks in Text
<p>This is the first line.<br>This is the second line.</p>
Try it out below:
powered by Advanced iFrame. Get the Pro version on CodeCanyon.
This code will create a break between the two sentences, displaying them on separate lines.
Example 2: Using
<br> in a Poem
<p><em>-William Shakespeare</em></p> <p>To be, or not to be,<br>that is the question:</p>
<br> tag is used to separate the lines of a poem, maintaining the poetic structure.
<br> tag is supported by all major browsers:
<br> tag also supports the Global Attributes in HTML.
<br> tag also supports the Event Attributes in HTML.
Default CSS Settings
<br> tag has no default CSS.
<br> tag is a simple yet essential tool in HTML, allowing for precise control over the layout of text.
By understanding its usage and how it renders in various browsers, developers can create more readable and aesthetically pleasing content.