HTML - Tag vs. element

What's the difference between a tag and an element?


The tag is part of the element.

<h1>This is a heading</h1>
<h1> is the start TAG
</h1> is the end TAG

h1 is the TAG name

The ELEMENT is the entire line. It includes the start tag, attributes, values, content, and end tag.

Ads by Google

Ask a question, send a comment, or report a problem - click here to contact me.

© Richard McGrath