What is the difference between tags and elements (HTML)?

Tags are just HTML tag that has just opening or closing entity. For example:
<p> and </p> are called HTML tags.

HTML element encompasses opening tag, closing tag, content (optional for content-less tags) Eg:
<p>This is the paragraph</p> : This complete thing is called a HTML element. 


<h3>This is the H3 heading level.</h3> Here, <h3></h3> are HTML tags and the entire statement, <h3>This is the H3 heading level.</h3> is referred as HTML element.

HTML attributes
An attribute defines a property for an element, consists of an attribute/value pair, and appears within the element’s start tag. An element’s start tag may contain any number of space separated attribute/value pairs.
The most popular misuse of the term “tag” is referring to alt attributes as “alt tags”. There is no such thing in HTML. Alt is an attribute, not a tag.

0 comments:

Feel free to contact the admin for any suggestions and help.