Difference between element and tag | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Difference between element and tag

difference between element and tag

26th Oct 2017, 1:01 PM
Kavya
3 Answers
+ 4
Sometimes these words are used interchangablly, but they are actually different. An element is a tag with a content but tag is just a notation like <div> or <img> which can contain or format a content. You can imagin a tag as a box and an element as a box filled with some objects.
26th Oct 2017, 1:27 PM
Vahid Shirbisheh
Vahid Shirbisheh - avatar
+ 2
I think the only difference is that element is a tag which is generally used inside another tag.
26th Oct 2017, 1:08 PM
Lakshay
Lakshay - avatar
0
A tag is coded in <p> form. An element is one or two tags with all the content between them so <p>Element</p> is an element.
26th Oct 2017, 1:11 PM
John Wells
John Wells - avatar