HTML Elements Reference Guide
HTML Elements Reference Guide

Till now, we have learned about the basic structure of a webpage and the bricks of an HTML page.,i.e., Tags, Elements, and Attributes. In this article, we are going to discuss the various HTML elements. Elements are responsible for adding meaning to the whole structure of an HTML document.

The fact that every HTML element has a different display and structure associated with it by default, we have the following diversions. So HTML Elements can be of three types:

  • Block Elements
  • Inline Block Elements
  • Empty Elements

Block HTML Elements

Block Elements in HTML displays an element that takes up the whole of the width available. They always start on a new line. They also have a top and a bottom margin, which appears as if a line break is used before and after the element.

Following is the list of commonly used block-level elements:

  1. <details>
    • Contains additional information that can be hidden.
  2. <div>
    • Divides the document or a section of it.
  3. <footer>
    • Contains the page footer.
  4. <form>
    • To make a HTML form with user inputs.
  5. <h1>, <h2>, <h3>, <h4>, <h5>, and <h6>
    • HTML has 6 headings with <h1> being the largest with 2em size, and <h6> being the smallest with 0.67 em.
  6. <header>
    • Contains the additional meta information about the document.
  7. <hr>
    • To add a horizontal line break in the document.
  8. <li>
    • To add list items into a list.
  9. <p>
    • To define a paragraph in the HTML document.
  10. <table>
    • To create an HTML table in the document.
<!DOCTYPE html>
<html>
<body>

<h1>H1 Heading</h1>
<hr/>
<p>A paragraph.</p>

</body>
</html>
Block HTML Elements in use
Block HTML Elements in use

Other block-level elements:

  • <address>
  • <article>
  • <aside>
  • <blockquote>
  • <dialog>
  • <dd>
  • <dl>
  • <dt>
  • <fieldset>
  • <figcaption>
  • <figure>
  • <main>
  • <nav>
  • <ol>
  • <pre>
  • <section>
  • <ul>

Inline HTML Elements

Inline elements are the ones that take the only width in which they are surrounded. They can be used within a block-level element and need not start on a new line.

One can not use block elements inside an inline tag whereas an inline element is primarily used inside a block element.

Following is the list of most commonly used inline html elements:

  1. <a>
    • Anchor tag which along with its attribute “href” is used to create hyperlink.
  2. <br>
    • To add a line break in text.
  3. <button>
    • To add a clickable button in the document.
  4. <em> or <i>
    • To make the text italic.
  5. <iframe>
    • To embed another HTML page into the document.
  6. <img>
    • To insert an image into the document. It is used with its “src” attribute.
  7. <input>
    • Provides an input field where user can enter data in a form.
  8. <label>
    • It represents a visible caption for an item in a user interface.
  9. <mark>
    • Highlights the text.
  10. <span>
    • It is like a div, which is used to add a small container for the text to style it differently.
  11. <del> or <s> or <strike>
    • To add strikethrough on some text.
  12. <strong> or <b>
    • Used to make text bold.
  13. <sub>
    • To add subscript text to an HTML document.
  14. <sup>
    • To add superscript text to an HTML document.
  15. <textarea>
    • It adds rows and columns to provide the space for text from user input within a form.
  16. <u>
    • Underlines the text.
<!DOCTYPE html>
<html>
<body>

<h1><a href="www.techbit.in">H1 Heading</a></h1>
<hr/>
<p><em>A paragraph.</em></p>
<p>A <span style="color:red;">paragraph.</span></p>

</body>
</html>
Inline HTML Elements in use
Inline HTML Elements in Use

Other inline elements:

  • <abbr>
  • <audio>
  • <bdi>
  • <bdo>
  • <canvas>
  • <site>
  • <code>
  • <data>
  • <datalist>
  • <dfn>
  • <embed>
  • <ins>
  • <kbd>
  • <map>
  • <meter>
  • <noscript>
  • <object>
  • <output>
  • <picture>
  • <progress>
  • <q>
  • <ruby>
  • <samp>
  • <script>
  • <select>
  • <slot>
  • <small>
  • <svg>
  • <template>
  • <time>
  • <var>
  • <video>
  • <wbr>

Empty Elements

Empty HTML elements are the ones that are not enclosed by a closing/end tag. They are also known as self-closing tags.

Hello!<br>
I am good.

However, it is a good practice to use an ending tag with these too. I have already covered more on empty elements here.

Hello!<br/>
I am good.

So that was all about HTML Elements and all its types. I’ll continue the series of articles to make you learn everything about HTML. Please do share your feedback on how these articles are helping you. Comment down your query if any.

Other articles worth your time:


Vaishali Rastogi

Hey There! I am Vaishali Rastogi and I am a tech-researcher. I've been doing writing for a good 4-5 years, so here I am now. Working on my own website to make people digitally aware of the updates in technology.

4 Comments

Aradhya · July 30, 2021 at 11:01 am

Useful content

Abhishek · July 30, 2021 at 1:05 pm

Very informative.

Leave a Reply to Vaishali_Rastogi Cancel reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

seven + 20 =