HTML Elements:-
An HTML Element is defined by start tags, some inside content, and some end tags.
An HTML element is everything from a start tag to the end tag.
(start tag) <tagname> some content that you want to write </tagname> (end tag).
EXAMPLE of some HTML elements:-
(start tag) <h1> This is heading tag </h1> (end tag).
<p> This is a paragraph tag. </p>
NOTE:- Some HTML elements have start tags but don't have end tags like <be> be has a start tag but does not have an end tag. This type of element is called an empty element. Empty elements don't have an end tag.
If you don't know what HTML Basic Intro click on the link and learn before learning HTML Elements.
NESTED Elements:-
Nested means depending on other things. In the HTML case, nested elements depend on other elements.
All HTML documents consist of Nested HTML elements.
The following example of Nested elements:-
Basically there are four main Nested <html>, <body>, <h>, <p>.
<!DOCTYPE html>
<html>
<body>
<h1> This is heading </h>
<p> This is a paragraph. <p>
</body>
</html>
Try it for a better experience.
Example Explained:-
<html> This is the root element and depends on the whole HTML document. In simple words <html> tells us this document type is HTML.
<html> This is the start tag </html> This is the end tag.
Then, inside the <html> there is a nested element <body> this is a nested element in <html>.
<body>
<h1> This is heading </h>
<p> This is a paragraph. <p>
</body>
The element <body> defines the document type body.
<body> This is start Nested tag is <html> </body> This is end Nested tag in Nested element.
Then, inside <body> there are two Nested elements <h>, and <p> there are two Nested elements in <body>.
<h1> This is heading </h>
<p> This is a paragraph. <p>
The <h> element defines the heading of the paragraph.
<h> This is the start tag </h> This is the end tag of <h>.
There are 6 types of heading h1, h2, h3, h4, h5, and h6.
<h1> This is heading </h>
The <p> element defines the paragraph.
<p> This is start tag </p> This is end tag.
<p> This is a paragraph. <p>
0 Comments