From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/html/element%2Fbr.html | 113 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 devdocs/html/element%2Fbr.html (limited to 'devdocs/html/element%2Fbr.html') diff --git a/devdocs/html/element%2Fbr.html b/devdocs/html/element%2Fbr.html new file mode 100644 index 00000000..c18df512 --- /dev/null +++ b/devdocs/html/element%2Fbr.html @@ -0,0 +1,113 @@ +

<br>: The Line Break element

The <br> HTML element produces a line break in text (carriage-return). It is useful for writing a poem or an address, where the division of lines is significant.

+

Try it

+
+

As you can see from the above example, a <br> element is included at each point where we want the text to break. The text after the <br> begins again at the start of the next line of the text block.

Note: Do not use <br> to create margins between paragraphs; wrap them in <p> elements and use the CSS margin property to control their size.

+
+

Attributes

+

This element's attributes include the global attributes.

+

Deprecated attributes

+
+clear Deprecated +

Indicates where to begin the next line after the break.

+

Styling with CSS

+
+

The <br> element has a single, well-defined purpose — to create a line break in a block of text. As such, it has no dimensions or visual output of its own, and there is very little you can do to style it.

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.

+
+

Examples

+ +

Simple br

+
+

In the following example we use <br> elements to create line breaks between the different lines of a postal address:

+

html

+
Mozilla<br />
+331 E. Evelyn Avenue<br />
+Mountain View, CA<br />
+94041<br />
+USA<br />
+
+

Result

+
+ + +
+
+

Accessibility concerns

+
+

Creating separate paragraphs of text using <br> is not only bad practice, it is problematic for people who navigate with the aid of screen reading technology. Screen readers may announce the presence of the element, but not any content contained within <br>s. This can be a confusing and frustrating experience for the person using the screen reader.

Use <p> elements, and use CSS properties like margin to control their spacing.

+
+

Technical summary

+
Content categories Flow content, phrasing content.
Permitted content None; it is a void element.
Tag omission Must have a start tag, and must not have an end tag. In XHTML documents, write this element as <br />.
Permitted parents Any element that accepts phrasing content.
Implicit ARIA role No corresponding role
Permitted ARIA roles +none, presentation +
DOM interface HTMLBRElement
+

Specifications

+
+ + +
Specification
HTML Standard
# the-br-element
+

Browser compatibility

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariWebView AndroidChrome AndroidFirefox for AndroidOpera AndroidSafari on IOSSamsung Internet
br1121Yes15≤44.418414≤3.21.0
clear1121Yes15≤44.418414≤3.21.0
+

See also

+
+

+ © 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
+ https://developer.mozilla.org/en-US/docs/Web/HTML/Element/br +

+
-- cgit v1.2.3