The following code shows an Example of Using the Div Tag in HTML.

Basically, we use the <div> tag when we need to divide the web page in different sections. The following example creates three sections of the web page using the <div> tag. Also, it shows the usage of the <sup> tag for creating the superscript. Also, the third div contains an unordered list which is created using the <ul> tag.

<html>
 <head>
   <title>My Details</title>
 </head>
 <body bgcolor="pink">
   <div style="height: 100px; background: #F3C3B9;">
       <center>
          <h1 style="color: red;">Vold Zels</h1>
          <h2><address style="color: blue;">Delhi</address></h2>
   </div>
   <div style="height: 200px; background: #B9F3EB; color:  #034F34;">
      <h2>Percentage: </h2>
      <p style="font-size: 25px;">10<sup>th</sup>: 85%</p>
      <p style="font-size: 25px;">12<sup>th</sup>: 95%</p>  
   </div>
   <div style="height: 200px; background: #F8F1A3; color: #803404;">
     <h2>Hobbies</h2>
     <p style="font-size: 20px;">
        <ul>
             <li>Writing</li>
             <li>Travel</li>
             <li>Singing</li>
             <li>Gardening</li>
             <li>Games</li>
             <li>Dance</li>
        </ul>
     </p>
   </div>
   <div style="background: #B1ADAA;height: 50px;">
      <center>
       <p>
            &copy; Copyright 2022, Vold Zels
       </p>
   </div>
 </body>
</html>

Output

Demonstrating an Example of Using the Div Tag in HTML
Demonstrating an Example of Using the Div Tag in HTML

Further Reading

HTML Examples for Beginners

Introduction to Django Framework and its Features

Django Practice Exercise

Installing Django on Windows

Examples of Array Functions in PHP

Basic Programs in PHP

Registration Form Using PDO in PHP

Inserting Information from Multiple CheckBox Selection in a Database Table in PHP

programmingempire

princites.com