HTML Elements
HTML Elements
HTML Elements
An HTML element usually consists of a start tag and end tag, with the content inserted in between
The HTML element is everything from the start tag to the end tag
Start tag | Element content | End tag |
---|---|---|
<h1> | My First Heading | </h1> |
<p> | My first paragraph. | </p> |
<br> |
HTML-Tags Vs Elements.
Technically, an HTML element is the collection of start tag, its attributes, an end tag and everything in between. On the other hand an HTML tag (either opening or closing) is used to mark the start or end of an element, as you can see in the above illustration.
The summary element
Nested HTML Elements
Nested HTML Elements
HTML elements can be nested (elements can contain elements).
All HTML documents consist of nested HTML elements.
Example
This example contains four HTML elements
<!DOCTYPE html> <html> <body> <h1>My First Heading </h1> <p>My first paragraph.<p> </body> </html>
HTML Document Output
My First Heading
My first paragraph.
0 Comments: