- HTML Course
- HTML Tutorial
- HTML Document Structure
- HTML Root Tags
- HTML Flow Tags
- HTML Interactive Tags
- HTML Basic Tags
- HTML Paragraph
- HTML Line Break
- HTML Horizontal Line
- HTML Images
- HTML Data Types
- HTML Attributes
- HTML Character Entities
- HTML Styles
- HTML Formatting Text
- HTML Logical Style Text
- HTML Organizing Text
- HTML List
- HTML Tables
- HTML Forms
- HTML action Attribute
- HTML Multimedia
HTML Line Break | HTML BR Tag
This article was written and distributed in order to provide a description of the BR tag, which is widely regarded as one of the most important and widely utilized HTML tags. As a result, let's get started on the topic without any further delay.
How to break a line in HTML
Using the BR tag is all that is required to break a line in HTML. That is to say, a line break will appear wherever you choose to write it (<BR>).
When writing the text, there may be times when it is necessary to insert line breaks at specific points in the document. Within an HTML document, a line break can be defined with the help of the BR element. For example:
<!DOCTYPE html> <html> <body> <p>Lorem ipsum dolor sit amet.</p> <p>Lorem ipsum <br> dolor sit amet.</p> </body> </html>
Lorem ipsum dolor sit amet.
Lorem ipsum
dolor sit amet.
A line break will occur after you have written a single BR character. When you use two BR, it will create two line breaks; when you use three BR, it will create three line breaks; and so on. Take, for instance:
<!DOCTYPE html> <html> <body> <p>Lorem, ipsum <BR>dolor sit<BR><BR> amet consectetur<BR><BR><BR> adipisicing elit. Ad numquam similique<BR><BR><BR><BR> corporis maiores <BR><BR><BR><BR><BR>nobis?</p> </body> </html>
Lorem, ipsum
dolor sit
amet consectetur
adipisicing elit.
Ad numquam similique
corporis maiores
nobis?
Following the production of the text "Lorem, ipsum" shown in the preceding example, a line break was created with the help of a single BR tag. After the text "dolor sit" was generated, two line breaks were executed by utilizing the two BR tags that were provided. In a manner analogous to this, the text "amet consectetur" was generated, followed by the insertion of three line breaks via the use of three BR tags, and so on.
Please note: Similar to the HR tag, the BR tag is also an empty tag. As a result, the BR tag is missing its end tag.
Don't be confused if you see <br/> or <br />, as it is also used to break the line. But I recommend that you only use the <br> to do the line break. The <br/> or <br />, in my opinion, is old-style. Because HTML5 recommends that the <br> is sufficient to apply a line break in a web page. As a result, there is no need for additional characters to perform the same function.
« Previous Tutorial Next Tutorial »