TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

HTML br tag

HTML br tag with examples, break line in html, forms, input, text, anchor, image, heading, marquee, textarea, paragraph, title, quotes, code etc.

<< Back to HTML

HTML <br> tag

The <br> tag in HTML document is used to create a line break in a text.

It is generally used in poem or address where the division of line is necessary. It is an empty tag, which means it does not need a company of end tag. If you place the <br> tag in the HTML code, then it works the same as pressing the enter key in a word processor.

Note: Don't use br tag for the margin between two paragraphs, use CSS margin property instead.

Syntax

Text <br> Text

Difference between HTML <br> and <br/>

You can use HTML br tag two ways: <br> or <br/>. It is recommended to use closed br tag <br/> because it is supported in HTML and XHTML both.

Example 1:

<!DOCTYPE HTML>
<html>
<head>
<title>
Example of BR tag
</title>
</head>  
<body>  
<p>If you want to break a line <br> in a paragraph, <br> use the BR element in <br> your HTML document. </p>  
</body>
</html>  
Test it Now

Output:

HTML br tag

Example 2: The following example uses the <br> tag in the address:

<!DOCTYPE HTML>
<html>
<head>
<title>
Example of BR tag in Address
</title>
</head>  
<body> <font color="green"> <!-The color attribute displays the color of following address in green --> 
<p>Central park <br> 
D.M Road, <br>
New Delhi, <br>
India <br> 
</body>
</html>  
Test it Now

Output:

HTML br tag

Example 2: The following example uses the <br> tag in the poem:

<!DOCTYPE HTML>
<html>
<head>
<title>
Example of BR tag in Poem
</title>
</head>  
<body> <font color="green"> 
<center> Dreams

</center>
Hold fast to dreams <br>

For if dreams die <br>

Life is a broken-winged bird <br>

That cannot fly. <br>
 
Hold fast to dreams <br>

For when dreams go <br>

Life is a barren field <br>

Frozen with snow. <br>
</body>
</html>  
Test it Now

Output:

HTML br tag

Browser Support

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<br>YesYesYesYesYes

Next TopicHTML button tag




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf