HTML - Elements




HTML Elements

HTML elements are the names of the starting tags of your HTML code. When you find an element containing additional content you will see that it ends up using a closing tag has a forward slash with the name of the element.

Here are some of the common examples of elements and how they are written.

For Example
tag Example
<p> <p>Paragraph elements are used for giving paragraph spacing to statements.</p>
<h1> <h1>Heading elements are used to provide a heading to articles of your web page.</h1>
<br/> <br/>Line break is used to provide carriage return or going to the next line.

An HTML element generally consists of a start tag and end tag, with the content inserted in between −

All HTML tags are open and close, And content is given in between. The given content is done according to the tag.

<tagname>Your Content goes here...</tagname>

Following are the major HTML elements

<p>This is paragraph content.</p>
<h1>This is heading content.</h1>
<div>This is division content.</div>

Nested HTML Elements

HTML documents consist of nested HTML elements, for example.

Example

<!DOCTYPE html>
<html>
<head>
    <title>Example for Nested HTML Elements</title>
</head>
<body>
<h1>This is my Heading</h1>
<p>This is my paragraph.</p>
</body>
</html>

Result

Example for Nested HTML Elements

This is my Heading

This is my paragraph.