Heading
We have six types of tags to display heading i.e., <h1>, <h2>, <h3>, <h4>, <h5>, <h6>. These tags h1 to h6 are defined to different font sizes. The size decreses from h1 to h6.
The font size of each tag represents
h1 - 32 px (2em)
h2 - 24px (1.5em)
h3 - 18.72px (1.17em)
h4 - 16px (1em)
h5 - 13.28px (0.83em)
h6 - 12px (0.75em)
This values are defaultly fixed to that tag. we no need to adject the size for the heading.
Example
<!DOCTYPE html>
<html>
<body>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>
</body>
</html>
Try it . . .
Paragraph
In the HTML we have only one paragraph tag that is denoted with <p>. The content which you want to display in the paragraph write between the <p> </p>
Font-Size of paragraph tag is 10px
Example
<!DOCTYPE html>
<html>
<body>
<p> This is paragraph. </p>
</body>
</html>
Try it . . .
Formatting text
This Formatting text tags are used to decorate the text in heading or paragraph. The tags used to Text Formatting are <i>, <b> <sub>, <sup>.
i - Itallic
b - Bold
sub - Subscript
sup - Superscript
Example
<!DOCTYPE html>
<html>
<body>
<h3>This text is heading size 3</h3>
<p><i>This text is italic</i></p>
<p><b>This is </b><sub>
subscript</sub><b> and</b>
<sup>superscript</sup></p>
</body>
</html>
Try it . . .
Comments
Comments are used to explain the code. The text which commented doesn't effects the code. We can write n no.of lines in the comments it doesn't reflects in the code.
The comments in HTML are denoted with <!-- Content -->
Exaxmple
<!Doctype html>
<head>
<title>Comments </title>
</head>
<body>
<!-- This content is Commented -->
<h3> Hello World! </h3>
</body>
Try it . . .
Tags:
HTML