Difference between HTML Elements and Tags?

There is a slight difference between HTML elements and tags. Tags are in source code while elements are in processed tags

 HTML elements:
An element is the building block of HTML.And it consist of two basic tags:
1. Opening tag
2. Closing tag
In other words, elements are the entire HTML block that creates a paragraph. An element in HTML represents some kind of structure and consists of a start tag, content, and an end tag. The following is a paragraph element:
Life is like a race. There come a lot of ups and downs in a life of a man. But he has to face them with patience.
This complete thing is called HTML element.
Some HTML elements <br> do not have a closing tag. such type of elements are called “void “elements. Void elements are easy to use because we can include only one tag in our web page. Elements can be defined in a certain order.
HTML tags:
HTML tag is just opening or closing entity. Tags are used to mark up the start and end of an HTML element’s start tag consist of an opening angle bracket (<) followed by the element name, value pairs and closing angle bracket (>).
1. A start tag with no attributes:
2. A start tag with an attribute:
<p class=”gull”>
End tag consists of an opening angle bracket followed by a forward slash, the element name and closing angle bracket:
3. </p>
There are also some elements that are empty its mean that it consist of a single tag and do not have ant content. in HTML such type of tags look like opening tags:
4. <br>
Share on Google Plus

About bilal S

I am founder of and a Computer Scientist. I have studied Computer Science and currently enrolled research student .I am providing information about computer, s web Programming Languages, Architecture and All other basic information Such as Information Technology and Computer Science. For Any Query and suggestion you are always welcome to contact me.
    Blogger Comment
    Facebook Comment


Post a Comment