An HTML document is made up of Elements. Every HTML element is defined by a start tag(opening tag), some content and an end tag(closing tag). Everything which has a starting and ending tag is an HTML element.


For example: The <p> element represents the paragraph of the document.


Difference between Tags and Elements


Technically, the terms HTML Tags and HTML Elements are exactly the same that is a Element is a Tag and a Tag is a Element.


HTML Elements Types


The HTML elements are divided into two categories, they are

  • Block-level element
  • Inline element

Block-level element


These elements starts with a new line and make up the document's of a web page. Block-level elements occupies the entire available width of a web page from left to right. Block-level elements also contain inline elements in it.

Some of the Block-level elements are,


<h1> to <h6>, <p>, <hr>, <div>, <pre>, <form>, <footer>, <table>, <address>, <video>, etc.

Example Program:

<!DOCTYPE html>
<html>
  <head>
     <title>
          Welcome To HTML5 Tutorial.
     </title>
  </head>
  <body>
       <p style="background-color: red">This is the paragraph element.</p>
          <div>
               <p>The div element starts from here</p>
               <h1>This is Heading level 1 element</h1>
               <h2>This is Heading level 2 element</h2>
          </div>
  </body>
</html>

Inline Element


An inline element does not start with a new line and does not take the full width of a web page. The Inline element are used within other HTML elements.

Some of the Inline elements are:


<a>, <script>, <button>, <br>, <img>, <i>, <b>, <lable>, <select>, <var>, <strong>, etc.

Example Program:

<!DOCTYPE html>
<html>
  <head>
     <titlt>
         Welcome To HTML5 Tutorial.
     </title>
  </head>
  <body>
     <p>This is the first line and<br>This is the second line</p>
     <a href="https://www.svrrtech.com"><b><i>Official Website</b></i></a>
  </body>
</html>

Post a Comment

Previous Post Next Post