What is the difference between a tag and an element?


#1

Hi guys my name is human dictionary:) and I need help figuring out the difference between an HTML tag and an HTML element.


#2

Tag:
<tag> and </tag>
Element:
<tag>content<tag>

(A tag is just the opening/closing , and an element is the tags, as well as the content.)

If you’re a human dictionary, shouldn’t you know that? :smiley:


#3

Yeah okay I get that, but isn’t a tag technically an element since it is between two angle brackets?


#4

A tag is a <tag>. Being between <> doesn’t make it an element, it makes it a tag. An element contains content as well as the enclosing tags;

<tag> <-- that's a tag

<tag> <-- all of
content <-- this is
</tag> <-- an element

#5

Thank You :slight_smile: jibblyj


#6