- Get link
- X
- Other Apps
Paragraphs
Paragraph is very popular element of language. Paragraph element is used to write content in paragraph format. It gives a paragraph look to the text written between the opening and closing tags of paragraph. we can use simple p tag for paragraph element.
<p>Tag
<p> tag is the paragraph tag that is used to create paragraphs in HTML document. <p> tag is a paired tag . It has both opening and closing tags.
Syntax :
<p>Your text here</p>
Let us see a example of paragraph tag:
The HTML:
<html>
<head>
<title>First Paragraph</title>
</head>
<body>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</body>
</html>
Result:
Note: Browsers automatically add an empty line before and after paragraph.
Single Line Break
Sometime we like to add a empty line before or after text.This empty line can be used before starting document/paragraph or after that, we can also use it in between. This empty line is called as Line Break.
For example, I added a empty line before starting this paragraph.An unpaired tag is used to write line break. This line break is also an element of html.
<br /> Tag
<br /> tag is used to add a line break. It is self closing and unpaired tag.
For example:
The HTML:
<html>
<head>
<title>First Paragraph</title>
</head>
<body>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<p>This is <br />a line break.</p>
</body>
</html>
Result:
Opening the HTML file in the browser shows that a single line break has been added to the paragraph:
Note: The <br /> element is an empty HTML element. It has no end tag.
Comments
Post a Comment
If you have any doubt, ask here