Nested HTML Elements
- When an HTML element is used inside another, it’s called a nested element.
- For instance, the
<html>
tag contains the<head>
and<body>
tags, forming a nested structure.
Example: This example describes the use of Nested HTML elements. Here, the <html> tag contains the <head> and <body>. The <head> and <body> tag contain other elements so it is called a nested element.
<!DOCTYPE html>
<html>
<head>
<title>HTML Elements</title>
</head>
<body style="text-align: center">
<h1>w3wiki</h1>
<p>Computer science portal</p>
</body>
</html>
Output:
HTML Elements
An HTML Element is a collection of start and end tags with the content inserted between them. HTML elements are building blocks of web pages, representing different types of content such as headings, paragraphs, links, and images.
Contact Us