HTML Element
HTML Basic Tags
HTML basic tags are fundamental elements used to structure and format content on web pages.
These tags provide the building blocks for creating web documents.
What is Element in HTML?
HTML element is defined by a starting tag.
If the element contains other content, it ends with a closing tag, where the element name is preceded by a forward slash as shown below with few tags:
HTML Elements
Start Tag | Content | End Tag |
---|---|---|
<html> | This is html element | </html> |
<p> | This is paragraph content | </p> |
<h1> | This is heading content | </h1> |
<div> | This is division content. | </div> |
Nested HTML Elements
All HTML documents consist of nested HTML elements.
The <html> element is the root element and it defines the HTML document.
Example
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph Hussein.</p>
</body>
</html>
Try it Yourself »
Body tag
The <body> element defines the document's body.
The <body> element includes all the contents of an HTML document, consisting of headings, paragraphs, links, tables, lists, etc.
Example
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
Try it Yourself »