HTML
Tag - W3docs

w3docs logo Books Learn HTML Learn CSS Learn Git Learn Javascript Learn PHP Learn python Learn Java Exercises HTML JavaScript Git CSS PHP Courses Quizzes Snippets Tools General Tools
  • Password Generator
  • HTML Editor
  • HTML Encoder
  • Base 64
  • Code Diff
  • JSON Beautifier
  • CSS Beautifier
  • Markdown Convertor
  • Find the Closest Tailwind CSS Color
  • Phrase encrypt / decrypt
  • Browser Feature Detection
  • Number convertor
CSS Maker
  • CSS Maker
  • CSS Maker text shadow
  • CSS Maker Text Rotation
  • CSS Maker Out Line
  • CSS Maker RGB Shadow
  • CSS Maker Transform
  • CSS Maker Font Face
Color Tools
  • Color Picker
  • Colors CMYK
  • Colors HWB
  • Colors HSL
  • Color Hex
  • Color mixer
  • Color Converter
  • Colors RGB
  • Color Contrast Analyzer
  • Color Gradient
String Tools
  • String Length Calculator
  • MD5 Hash Generator
  • Sha256 Hash Generator
  • String Reverse
  • URL Encoder
  • URL Decoder
  • Base 64 Encoder
  • Base 64 Decoder
  • Extra Spaces Remover
  • String to Lowercase
  • String to Uppercase
  • Word Count Calculator
  • Empty Lines Remover
  • HTML Tags Remover
  • Binary to Hex
  • Hex to Binary
  • Rot13 Transform on a String
  • String to Binary
  • Duplicate Lines Remover
Change theme
  • Dark
  • Light
  • System
  • HTML Basics HTML IntroductionEditors & ToolsHTML ElementsHTML Basic TagsHTML AttributesHTML HeadingsHTML FormattingHTML LinksHTML ListsHTML ColorsHTML CommentsHTML TablesHTML BlocksHTML ScriptsHTML Styles - CSSHTML File PathsHTML Computercode
  • HTML Templates Layout TemplatesForm Templates
  • HTML 5 HTML5 IntroductionHTML5 TagsSemantic ElementsAudio & VideoHTML5 Browser SupportHTML5 Migration
  • HTML References Character SetsASCIIISO-8859-1ISO Language CodesUTF-8 EncodingHTML EntitiesKeyboard ShortcutsHTTP MethodsHTML ImagesHTTP Status MessagesMIME-TypesTable of HTML TagsXHTMLHTML URL
  • HTML Tags Deprecated TagsHTML Global AttributesEvent Attributes<!-- ... --><!DOCTYPE><a><abbr><acronym><address><applet><area><article><aside><audio><b><base><basefont><bdi><bdo><big><blink><blockquote><body><br><button><canvas><caption><center><cite><code><col><colgroup><data><datalist><dd><del><details><dfn><dialog><dir><div><dl><dt><em><embed><fieldset><figcaption><figure><font><footer><form><frame><frameset><h1>-<h6><head>
  • <header><hgroup><hr><html><i><iframe><img><input><ins><isindex><kbd><keygen><label><legend><li><link><main><map><mark><marquee><menu><menuitem><meta><meter><nav><nobr><noframes><noscript><object><ol><optgroup><option><output><p><param><plaintext><picture><pre><progress><q><rb><rp><rt><rtc><ruby><s><samp><script><section><select><small><source><spacer><span><strike>
  • <strong><style><sub><summary><sup><svg><table><tbody><td><template><textarea><tfoot><th><thead><time><title><tr><track><tt><u><ul><var><video><wbr><xmp>
  • Canvas Tutorial Canvas IntroCanvas DrawingCanvas CoordinatesCanvas GradientsCanvas TextCanvas ImagesCanvas Reference
  • SVG Tutorial SVG IntroSVG in HTML5SVG RectangleSVG CircleSVG EllipseSVG LineSVG PolygonSVG PolylineSVG PathSVG TextSVG StrokingSVG Filters IntroSVG Blur EffectsSVG Drop ShadowsSVG LinearSVG RadialSVG Reference
  • HTML Attributes Deprecated AttributesHTML Class AttributeHTML id Attribute
  • HTML Media HTML MultimediaHTML YouTube Videos
  • HTML Forms HTML Forms
  • HTML Attribute Reference altasyncacceptcontentcontenteditablecontrolscoordsdisableddownloaddraggableautocompleteautofocusdeferdircolspanaccesskeyactionautoplaycheckedaccept-charset
HTML <br> Tag ❮ Prev Next ❯

Definition

The HTML <br> tag defines a line break. Unlike the <p> tag defining a paragraph, an empty indent is not added before the line.

br exemple

Syntax

The <br> tag is empty, which means that the closing tag isn’t required. But in XHTML, the (<br>) tag must be closed (<br/>).

Example of the HTML <br> tag:

<!DOCTYPE html> <html> <head> <title>Title of the document</title> </head> <body> <h1>Example of the &lt;br&gt; tag usage.</h1> <p> Inside the paragraph, we can put the tag &lt;br /&gt;, <br> to transfer a part of the text to another line if necessary.</p> </body> </html> Try it Yourself »

Usage

The <br> tag is used to enter line breaks. It is useful for writing addresses, poems or song lyrics.

Do not use <br> tag to separate paragraphs. It is very problematic to use <br> tag to separate the paragraph for the people who navigate through the screen reading technology. Use <p> elements and CSS margin property to control spacing.

Example of the HTML <br> tag for entering line breaks:

<!DOCTYPE html> <html> <head> <title>Title of the document</title> </head> <body> <h1>Example of the &lt;br&gt; tag usage</h1> <blockquote> But I'm not the only one<br> I hope some day you'll join us<br> And the world will live as one.<br> </blockquote> <cite>John Lennon "imagine"</cite> </body> </html> Try it Yourself »

Attributes

Attributes Value Description
clear Specifies how to process the next line if the text wraps around the floating element.Not used in HTML5.
all Reverses the flow around the element from the right and left edges at the same time.
left Reverses the flow from the left side of the element placed after the <br> tag.
right Reverses the flow from the right side.
none Cancels the action of an attribute.

The <br> tag supports the Global Attributes and the Event Attributes.

Browser support

chrome edge firefox safari opera

Practice Your Knowledge

What is the purpose of the HTML <br> tag and how is it used? It defines a hypertext link It produces a line break in text It can contain other HTML elements inside of it It should be used instead of <p> tags for paragraphs It doesn't have an end tag and contains no content Correct Answer Correct! Wrong Answer Incorrect! Submit

Quiz Time: Test Your Skills!

Ready to challenge what you've learned? Dive into our interactive quizzes for a deeper understanding and a fun way to reinforce your knowledge.

  • HTML Basics
❮ Prev Next ❯

Related Resources

  • HTML <hr> Tag
  • HTML <wbr> Tag
  • HTML <bdi> Tag
  • How to Create Button with Line Breaks
  • How to Display the Hidden Element on Hovering Over Hyperlink or <a> Tag
  • How to Center an Absolutely Positioned Element in a Div
  • How to Break Line Without Using <br> Tag in CSS
Sorry about that How can we improve it? Submit Thanks for your feedback! Thanks for your feedback! Do you find this helpful? Yes No Quizzes
  • PHP basics
  • HTML Basics
  • Javascript Basics
  • CSS Basics
  • ES6 Basics
  • TypeScript Basics
  • React Basics
  • Angular Basics
  • Sass Basics
  • Git Basics
  • Vue.js Basics
  • SQL Basics
  • Python Basics
  • Java Basics
  • NodeJS Basics

Từ khóa » Html Br Options