Break Line
The HTML <br> element produces a line break in text (carriage-return). It is useful for writing a poem or an address, where the division of lines is significant.
The HTML <br> element defines a Line Break.
use <br> if you want a Line Break (a new line ) without starting a new paragraph.
Break line <br> element is a Inline level element.
The <br> tag is an empty tag, which means that it has no end tag.
Example
<!DOCTYPE html>
<html>
<head>
<title>Jingle bell Poem</title>
</head>
<body>
<p>
Jingle bells<br>
Jingle bells<br>
Jingle all the way<br>
Oh, what fun<br>
It is to ride<br>
In a one-horse open sleigh<br>
<br>
Dashing through the snow<br>
In a one-horse open sleigh<br>
O’er the fields we go<br>
Laughing all the way<br>
Ha ha ha<br>
Bells on bobtail ring<br>
Making spirits bright<br>
What fun it is to ride and sing<br>
A sleighing song tonight<br>
Repeat Chorus Two Times<br>
<br>
Now the ground is white<br>
And the night is young<br>
Take the sleigh tonight<br>
And join us in this song<br>
Just get a bobtailed bay<br>
Get ready for a run<br>
Then hitch him to a sleigh<br>
And now we’ll have some fun!
</p>
</body>
</html>
Output
Jingle bells
Jingle bells
Jingle all the way
Oh, what fun
It is to ride
In a one-horse open sleigh
Dashing through the snow
In a one-horse open sleigh
O’er the fields we go
Laughing all the way
Ha ha ha
Bells on bobtail ring
Making spirits bright
What fun it is to ride and sing
A sleighing song tonight
Repeat Chorus Two Times
Now the ground is white
And the night is young
Take the sleigh tonight
And join us in this song
Just get a bobtailed bay
Get ready for a run
Then hitch him to a sleigh
And now we’ll have some fun!
As you can see from the above example, a
<br>
element is included at each point where we want the text to break. The text after the <br>
begins again at the start of the next line of the text block.Note: Do not use <br> to create margins between paragraphs; wrap them
in <p> elements and use the CSS margin property to control their size.
0 comments:
Post a Comment
For Any Tech Updates, Hacking News, Internet, Computer, Technology and related to IT Field Articles Follow Our Blog.