Tags vs Elements vs Attributes in HTML

HTML Tags: Tags are the starting and ending parts of an HTML element. They begin with < symbol and end with > symbol. Whatever written inside < and > are called tags.

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<b> </b>

chevron_right


HTML elements: Elements enclose the contents in between the tags. They consist of some kind of structure or expression. It generally consists of a start tag, content and an end tag.



Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<b>This is the content.</b>

chevron_right


This is the content.

Where, <b> is the starting tag and </b> is the ending tag.

HTML Attributes: It is used to define the character of an HTML element. It always placed in the opening tag of an element. It generally provides additional styling (attribute) to the element.

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<p align="center">This is paragraph.</p>

chevron_right


This is paragraph.

HTML Tags HTML Elements HTML Attributes
HTML tags are used to hold the HTML element. HTML element holds the content. HTML attributes are used to describe the characteristic of an HTML element in detail.
HTML tag starts with < and ends with > Whatever written within a HTML tag are HTML elements. HTML attributes are found only in the starting tag.
HTML tags are almost like keywords where every single tag has unique meaning. HTML elements specifies the general content. HTML attributes specify various additional properties to the existing HTML element.


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.