HTML Page Structure

HTML Elements
HTML Attributes


HTML Elements

HTML is all about elements. In HTML, element is more abstract form of a tag in the hierarchical structure of an HTML document which consists of a start tag, content, and an end tag. HTML element encompasses attributes, other child elements and content such as text.

Example

<p>Adding content of paragraph element.</p>

There are many elements in HTML such as <p>..</p> <div>..</div> and many more. But there are some HTML elements which is not require to close such as <br/>,<hr/> etc.

Example

</br>
</hr>

HTML Elements List

The below table contains some elements and their description which is supported by HTML version.

Attribute NameAttribute Description
Span<span>..</span>
Div<div></div>
H1<h1></h1>
Br</br>

Difference Between Elements and Tags

Tags are labels that you generaly use to mark up the begining and end of an element. All tags have the same format they start with a "<" sign and end with a ">" sign.

For Example

<h1></h1>

Whereas elements are something that consists of start tag and end tag.

<h1>Page Heading</h1>

Elements can encompass attributes, child elements and other contents such as text.

<code><div>This is a div element</div></code>

HTML Elements

<!DOCTYPE html>
<html>
<head>
<title>My HTML Element code</title>
</head>
<body>
<div>
<p>
This is paragraph element inside div element 
</p> 
</div>
</body>
</html>