Topic 10 : DIV Elements

Div is vlock level element. which is used to hold or group other HTML elements together.

Basic Syntax:

<div>
          <!– Content goes here –>
</div>

Example:

<!DOCTYPE html>

<html lang="en">

  <head>

    <meta charset="UTF-8" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>Div Element (by rsportfolio)</title>

  </head>

  <body>

    <h2>Div Element</h2>

    <hr />

    <a href="">Google</a>

    <a href="">Mozilla</a>

    <div>

      <a href="">Opera</a>

    </div>

  </body>

</html>

Output:

Leave a Comment

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

Scroll to Top