<br> Tag in HTMLIntroductionHTML Stands for Hypertext Markup Language. We also call it the backbone of the internet. It is one of the markup languages which is used to create web pages and applications. One of HTML's most essential and powerful features is the <br> tag. With the help of this tag, we can provide a line between a paragraph. In this article, we will learn all the details about <br> tag. When we write an article in MS Word, the cursor will move to the next time we press enter key. In HTML, when we write any paragraph and need one line of space, we go for <br> tag. Examples of <br> TagExample 1: Let's take an example and write a poem without giving <br> tag and what we get in the output. Output: Explanation: In the above program, we write the poem by writing line breaks, but all the lines are converted into a single line in the output. Example 2: Let's rewrite the above code with the help of <br> tag and see what we got in the output. Output: Explanation: We got the output per our expected format after giving the <br> tag in the above code. Let's come to the definition of the <br> tag. Definition of <br> Tag in HTML<br> tag is an element in HTML used to produce a line break in an HTML document (carriage return). Syntax of <br> Tag:We can write the <br> tag with the help of the below syntax. Attributes of <br> Tag in HTMLIn HTML, <br> tag supports only two types of attributes. These two attributes are Global and event Handler attributes. 1. Global AttributesThe global attribute that is supported in HTML is as follows.
2. Event Handler AttributesWe want something returned as a response whenever we press any key or click. In that case, we take the help of the event handler. The list of event listeners supported by the <br> tag is as follows.
NOTE: The <br> tag is deprecated in HTML 5. So It Is no longer supported in HTML5 and should not be used.Example of <br> Tag with HTML & CSS CodeOutput: Difference between <br> and <br/> in HTML
Example of <br> Tag for Entering Line Breaks in HTMLOutput: Next TopicHTML button tag |