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
text content<br>text content
HTML br element is an inline element.
Whether both start and end tags are required
HTML br element requires start tag only.
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 specific to this element
language information and text direction
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.
The element does not support any event attributes.
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>
View this example in a separate browser window
- New Content published on w3resource:
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework