Basic Tags
This guide provides an overview of some basic HTML tags and how to use them effectively in your web pages.
HTML <br>
Tagβ
<br>
: Break Row
The <br>
tag is used to create line breaks or new lines within the content. It is an empty tag and does not require a closing tag.
syntax :
Text1 <br />
Text2
Code :
<!DOCTYPE html>
<html>
<head>
<title>Basic Tags</title>
</head>
<body>
Hello My Name is Jaadu <br />
I lost My Spaceship.
</body>
</html>
Output :
Bold Tagβ
In HTML <b>
tag defines bold text.
syntax :
<b>Bold Text</b>
Code :
<!DOCTYPE html>
<html>
<head>
<title>Basic Tags</title>
</head>
<body>
Normal Text <br />
<b>Bold Text</b>
</body>
</html>
Output :
Italic Tagβ
In HTML <i>
tag defines Italic text.
Syntax :
<i>Text</i>
Code :
<!DOCTYPE html>
<html>
<head>
<title>Basic Tags</title>
</head>
<body>
Normal Text <br />
<i>Italic Text</i>
</body>
</html>
Output :
Nested Tagsβ
<i><b>Sample Text</b></i>
OR
<b><i>Sample Text</i></b>
Code :
<!DOCTYPE html>
<html>
<head>
<title>Basic Tags</title>
</head>
<body>
<i><b>Sample Text</b></i
><br />
<b><i>Sample Text</i></b>
</body>
</html>
output :
Underline Tagβ
In HTML <u>
tag are used to underline a text.
Syntax :
<u>Underline Text</u>
Code :
<!DOCTYPE html>
<html>
<head>
<title>Basic Tags</title>
</head>
<body>
Normal Text <br />
<u>This is underline Text</u>
</body>
</html>
Output :
Delete Tagβ
It is used to mark a portion of text which has been deleted from the document.
<del>Delete Text</del>
Code :
<!DOCTYPE html>
<html>
<head>
<title>Basic Tags</title>
</head>
<body>
<del>20,000</del> 900
</body>
</html>
Output :
Superscriptβ
Superscript is a number or letter that written above the normal text.
Code :
10<sup>th</sup>
π»Example :
<!DOCTYPE html>
<html>
<head>
<title>Basic Tags</title>
</head>
<body>
10th<br />
10<sup>th</sup><br />
</body>
</html>
Output :
### SubscriptSubscript is a number or letter that written below the normal text.
H<sub>2</sub>O
Code :
<!DOCTYPE html>
<html>
<head>
<title>Basic Tags</title>
</head>
<body>
H20<br />
H<sub>2</sub>0
</body>
</html>
Output :
<hr />
Tagβ
<hr />
Tag is Horizontal Rule that is used to sepreate content.
Code :
<!DOCTYPE html>
<html>
<head>
<title>Tag</title>
</head>
<body>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quasi culpa,
eveniet cum est quis atque possimus rerum officia perferendis quidem
mollitia ab, nulla animi, praesentium excepturi dolore illo iusto
suscipit.
</p>
<hr />
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quasi culpa,
eveniet cum est quis atque possimus rerum officia perferendis quidem
mollitia ab, nulla animi, praesentium excepturi dolore illo iusto
suscipit.
</p>
</body>
</html>
Output :
Span Tagβ
<span> </span>
Span Tag is a text inline selector it is used to select a particular Text. Span tag does not have any own effect.
Code :
<!DOCTYPE html>
<html>
<head>
<title>Tag</title>
</head>
<body>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quasi culpa,
eveniet cum est quis atque possimus rerum officia perferendis quidem
mollitia ab, nulla animi, praesentium excepturi dolore illo iusto
suscipit.
</p>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quasi culpa,
eveniet cum est quis atque possimus rerum officia perferendis quidem
mollitia ab, nulla animi,
<span>praesentium excepturi dolore illo iusto suscipit.</span>
</p>
</body>
</html>
Output :