HTML br tag and element
1. HTML br (line break) element creates a line break in text within an HTML document.
2. Appropriate usage of the br element is to use it within a poem or an address.
3. HTML br element should not be used to create vertical space between two chunk of text or content. You must use stylesheets for that purpose.
4. br element can not contain any content by itself.
5. If you want to make sure that a line break does not occur between two words, use
Syntax
text content<br>text content
Category
HTML br element is an inline element.
Whether both start and end tags are required
HTML br element requires start tag only.
Can contain
HTML br element can not contain any element.
Can reside within
HTML br element can reside within inline as well as block level elements.
Attributes
Attributes specific to this element
None.
Identifiers
language information and text direction
Title
Style
clear
This attribute specifies the place of appearance of the next line in a visual browser, after a line break is created by br element. Possible values of this attribute are -
- none : The next line will begin normally. This is the default value.
- left : The next line will begin at nearest line below any floating objects on the left-hand margin.
- right : The next line will begin at nearest line below any floating objects on the right-hand margin.
- all : The next line will begin at nearest line below any floating objects on either margin.
This attribute is deprecated.
Events
The element does not support any event attributes.
Supported doctypes
HTML 4.01 Strict, HTML 4.01 Transitional, and HTML 4.01 Frameset.
Example of using HTML br element
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>html br tag example</title>
</head>
<body>
<p>Friends park<br>
St. Xaviers Road<br>
Kanainatshal<br>
Sripally<br>
</p>
</body>
</html>
Result
View this example in a separate browser window
Pictorial presentation
Previous: HTML p tag and element
Next: HTML pre tag and element
Test your Programming skills with w3resource's quiz.
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://w3resource.com/html/br/HTML-br-tag-and-element.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics