HTML elements are defined by Starting tag,Content and closing tag.
<tagname>content goes Here</tagname>
Example:
<p>This is a paragraph</p>
<h1>Heading Goes Here</h1>
Nested HTML Elements
- This means that HTML Elements can contains other Elements.
<a href="#"><p> Click Here</p></a>
<h1>This is a <b>Heading</b></h1>
- There are some HTML elements which don't need to be closed, such as <img.../>, <hr /> and <br /> elements. These are known as void elements.
HTML documents consists of a tree of these elements and they specify how HTML documents should be built, and what kind of content should be placed in what part of an HTML document.
<!DOCTYPE html>
<html>
<head>
<title>Nested Elements Example</title>
</head>
<body>
<h1>This is <i>italic</i> heading</h1>
<p>This is <u>underlined</u> paragraph</p>
<a href="https://www.w3schools.com">Back to School</a>
</body>
</html>