Paragraphs are created using the <p> tag. The paragraph breaks are added between the closing and opening <p> tag in the text.
<p> : Starts a new paragraph, <p> tag is used to end the paragraph
👉Line breaks
<p>
This is a paragraph
<br>
with line break
</p>
<br> tag
<!DOCTYPE html>
<html>
<head>
<title> BR Tag in HTML </title>
</head>
<body>
<h1> I am your friend<br>I like your smile </h1>
</body>
</html>
👉Horizontal rules
<hr> tag
Draws a horizontal line. The attribute size = "50%" (any percent will do) draws a line of that percentage of the screen width. The attribute align = can be used to move the line to left, center or right.
<!DOCTYPE html>
<html>
<head>
<title> HR Tag in HTML </title>
</head>
<body>
<h1 align = center> What is hr tag? </h1>
<hr color = red size = 10 width = 300 align = center>
The hr tag defines a thematic break in an HTML page. The hr element is most often displayed as a horizontal rule that is used to separate content in an HTML page.
<hr color = blue size = 5>
<body>
</html>
Attribute
- Left
- Right
- Center
- Justify
NOTES.....
The closing </p> tag, while not required, is important for defining the extract contents of a paragraph for CSS. Most web designers use it automatically, but if you don't need it, you can leave it out your HTML. Closing tags also required for XHTML 1.0.