HTML document contains the basic building blocks which are give below :

Before learning about the html elements we must be study about the HTML building block and HTML syntax and it's necessary. Now we learn about the HTML syntax and building block.

Tags

An HTML tag surrounds with some content and applies meaning to it and it is written between < and > brackets. Some bits of text which can be found inside the angle brackets along with the brackets are known as 'Tags'. This is used to split code from normal text. These two;  <html> and </html> and <head> and </head> are all tags come in pairs, as one <tag> is used to open the tag and </tagname> the other used to close the tag, the difference shown in the HTML tags above. we must always recollect to open and close the tags and must remember to use the angle brackets for them to work.

<tag name>content</tag>

Attribute

Attributes are used to define the more particular information within an element. They attribute generally come in name, value pairs, (name=“value”). Attributes can also be used to  resize images, change the size of font, colour of font and the text.

<tag name  attribute_name= "attribute_value"> content </ tag name>  
<p style="color: red">content</p> 

Elements

Elements are the tag as a entire, so this take in the opening tag, the text within and then the closing tag as well. The only role of elements where it can start to become tricky is when you have elements appearing within elements, however, if you practice this section a lot you will then acquire it's not tricky if you know where to put the element codes.

Example

<!DOCTYPE html> 
<html> 
 <head> 
  <title>HTML TITLE</title> 
</head> 
 <body> 
   <h2>Heading Tag</h2> 
   <p>Paragraph Tag</p> 
   <p style="color: blue;">The style is attribute of paragraph tag</p> 
   <span>The element contains tag, attribute and content</span> 
 </body> 
</html>
  Try it Yourself