- HTML Tutorial
- HTML - Home
- HTML - History and Evolution
- HTML - Overview
- HTML - Editors
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Headings
- HTML - Paragraphs
- HTML - Quotations
- HTML - Comments
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Style Sheet
- HTML - CSS Classes
- HTML - CSS IDs
- HTML - Images
- HTML - Image Map
- HTML Tables
- HTML - Tables
- HTML - Headers & Caption
- HTML - Table Styling
- HTML - Table Colgroup
- HTML - Nested Tables
- HTML Lists
- HTML - Lists
- HTML - Unordered Lists
- HTML - Ordered Lists
- HTML - Definition Lists
- HTML Links
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Iframes
- HTML - Blocks
- HTML Backgrounds
- HTML - Backgrounds
- HTML Colors
- HTML - Colors
- HTML - RGB
- HTML - HEX
- HTML - HSL
- HTML Forms
- HTML - Forms
- HTML - Form Attributes
- HTML - Form Control
- HTML - Input Attributes
- HTML Media
- HTML - Video Element
- HTML - Audio Element
- HTML - Embed Multimedia
- HTML Header
- HTML - Head Element
- HTML - Adding Favicon
- HTML - Javascript
- HTML Layouts
- HTML - Layouts
- HTML - Layout Elements
- HTML - Layout using CSS
- HTML - Responsiveness
- HTML - Symbols
- HTML - Emojis
- HTML - Style Guide
- HTML Graphics
- HTML - SVG
- HTML - Canvas
- HTML APIs
- HTML - Geolocation API
- HTML - Drag & Drop API
- HTML - Web Workers API
- HTML - WebSocket
- HTML - Web Storage
- HTML - Server Sent Events
- HTML Miscellaneous
- HTML - MathML
- HTML - Microdata
- HTML - IndexedDB
- HTML - Web Messaging
- HTML - Web CORS
- HTML - Web RTC
- HTML Demo
- HTML - Audio Player
- HTML - Video Player
- HTML - Web slide Desk
- HTML Tools
- HTML - Velocity Draw
- HTML - QR Code
- HTML - Modernizer
- HTML - Validation
- HTML - Color Code Builder
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
- HTML Resources
- HTML - Quick Guide
- HTML - Useful Resources
- HTML - Color Code Builder
- HTML - Online Editor
HTML - <br> Tag
In HTML, a paragraph usually begins on a new line, but what if you want content within a paragraph to begin on a new line. In that scenario’s we are going to use the HTML line break.
A line break in a text can be made using the HTML <br> tag. When the division of a line is required, it is used. Being an empty tag, it is not dependent on an end tag. The <br> tag behaves just like pressing the enter key in a word workstation, when it is used in the HTML code.
Syntax
Following is the syntax of the <br> tag −
<p> …content <br> …content <br> …content </p>
Example
In the following example, let's see the usage of the <br> element in the HTML documents as follows −
<!DOCTYPE html> <html> <body> <p align="center">Geckos are a group of usually small, usually nocturnal lizards. <br> They are found on every continent except Antarctica. </p> </body> </html>
On running the above code, you can see that the <br> begins again at the start of the next line of the text block.
Example
Let's look at the another scenario, where we are going to use the <br> tag to print the address in the new line.
<!DOCTYPE html> <html> <body> <p>Mozilla <br /> 331 E. Evelyn Avenue <br /> Mountain View, CA <br /> 94041 <br /> USA <br /> </p> </body> </html>
On running the above code, the output window will pop up, displaying the address that begins on a new line where the <br>tag is used.
Example
Considering the following example, where we are going to use the<br> tag to display each input field in the new line.
<!DOCTYPE html> <html> <body> <form> <input type="text" placeholder="Enter your name" /> <br> <input type="phone" placeholder="Enter your phone" /> <br> <input type="email" placeholder="Enter your email" /> </form> </body> </html>
When we run the above code, it will generate an output consisting of the three input fields separated by the <br> tag to make each input field start on a new line.