HTML Elements

An element in an HTML document can be understood as an individual component of an HTML file. In more simple words, the elements are everything written within tags, including the tags, attributes and the contents.

Basic elements used in HTML are:

<h1> ...... <h6>Content</h1> ...... </h6>

They are used to specify the headings of page.


It is used to specify a content as a paragraph.


It is used to specify a section in web page.


It is used to specify a line break.


It is used to specify a horizontal line.


<h1 style="color: red">Hello</h1>  
<p style="color: blue">World!!</p>  





Void Elements:
Elements with no contents and end tags are called Void or empty elements. Example

Nested HTML Elements:
An element containing another element is called the Nested HTML Element.

Block-level element:
Elements which structure the main part of the web page is the Block-level element. It divides a page into coherent blocks and takes the full width of the web page, from left to right. It always starts with a new line.

The block-level elements in HTML are:

<address>, <article>, <aside>, <blockquote>, <canvas>, <dd>, 
<div>, <dl>, <dt>, <fieldset>, <figcaption>, <figure>, <footer>, 
<form>, <h1>-<h6>, <header>, <hr>, <li>, <main>, <nav>, <noscript>, 
<ol>, <output>, <p>, <pre>, <section>, <table>, <tfoot>, <ul>, <video>

Inline elements:
Elements which differentiate the part of a given text is called an Inline element. It also provides a particular function to the differentiated part of the text, and take width as per requirement. It does not start with a new line and is mostly used with some other elements.

The inline elements in HTML are:

<a>, <abbr>, <acronym>, <b>, <bdo>, <big>, <br>, <button>, <cite>, 
<code>, <dfn>, <em>, <i>, <img>, <input>, <kbd>, <label>, <map>, 
<object>, <q>, <samp>, <script>, <select>, <small>, <span>, <strong>, 
<sub>, <sup>, <textarea>, <time>, <tt>, <var>
Please Share