What is an HTML element?
If you want to know about HTML element then this lesson is very special for you.
Because in this lesson, the HTML element has been discussed in detail with examples.
HTML element definition
The HTML element is a component of an HTML document that contains Start Tag, if the element contains Some Content and End Tag.
Understand this with the following example:
Example Explanation:
From <Start Tag>
to <End Tag>
including text is an element.
An HTML element consists of a start tag, content and a last tag.
HTML element as a heading tag
The element used for the heading of the article will look like this:
HTML element as a paragraph tag
The element used for the paragraph will look like this:
When we start writing a paragraph, we must first write the start tag <p>
, write the article of the paragraph after the start tag, </p>
Close the element with an end tag.
HTML element's components
Understand this further with the following example:
Start tag | Element content | End tag |
---|---|---|
<h1> | My First Heading | </h1> |
<p> | My first paragraph. | </p> |
<br> | none | none |
Note:
Some HTML elements do not have content, as can be seen <br> in the example above, these are empty elements, Empty element does not have an end tag.