HTML is all about elements. In HTML, element is more abstract form of a tag in the hierarchical structure of an HTML document which consists of a start tag, content, and an end tag. HTML element encompasses attributes, other child elements and content such as text.
Example
There are many elements in HTML such as <p>..</p> <div>..</div> and many more. But there are some HTML elements which is not require to close such as <br/>,<hr/> etc.
Example
The below table contains some elements and their description which is supported by HTML version.
Attribute Name | Attribute Description |
---|---|
Span | <span>..</span> |
Div | <div></div> |
H1 | <h1></h1> |
Br | </br> |
Tags are labels that you generaly use to mark up the begining and end of an element. All tags have the same format they start with a "<" sign and end with a ">" sign.
For Example
Whereas elements are something that consists of start tag and end tag.
Elements can encompass attributes, child elements and other contents such as text.