Basic Tags

The Table 1 shows the list of tags which are required for writing the basic ‘HTML’ codes i.e. without any style e.g. bold, italics and numbering etc.

Table 1: List of Tags in Basic HTML
Tag Description Example
h1, . . . , h6 Header tag h1 to h6 <h2> Hi </h2>
p paragraphs (Line changes at the end) <p> Hi </p>
span No line change after span <span>Hi</span> Bye.
div make division between contents <div> . . . </div>
a Anchor tag or hyperlink <a href="link"> Link to </a>
center Move content to center <center> Hi </center>
br Line break (no closing tag) <br> Or <br/>
hr horizontal line (no closing tag) <hr> Or <hr/>
pre preserve formatting <pre> . . . . </pre>
table insert table <table> . . table . . </table>

Let’s see the example of each of these tags,

NOTE: All the new codes are added below the previous codes in the ‘body’ tag. Therefore only newly added codes are shown in the tutorial.
 
			1 <h2> Heading 2 </h2>
2 <h6> Heading 6 </h6>
3 <p> This is paragraph </p>
4 <span> This is span.</span>
5 <span> The 'br' tag is used after span to break the line </span> 6 <br/>
7 <div style="color:blue;">
8 The 'div' tag can be used for formatting the tags inside it at once using 'style' and 'classes' etc.
9 <p> This paragraph is inside the 'div' tag </p>
10 <span> This span is inside the 'div' tag </span>
11 <br/>
12 </div>
13 <center>
14 <h3> Heading 3 is centered</h3>
15 <p><span> Centered span inside the paragraph.</span><p>
16 </center>
17 Two horizontal line is drawn using two 'hr' tag.
18 <hr/>
19 <hr>
20 <pre> 'pre' tag preserve the formatting (good for writing codes) 21 # Python code
22 x = 2
23 y = 3
24 print(x+y)
25 </pre>

© Copyright 2025 | FolkLight Studios