"if you encounter any errors in SAP, send me a screenshot at pramod@learntosap.com, and I will help you resolve the issue."

HTML Div Element Tag –

HTML TUTORIALS-

HTML Div Element Tag –

Introduction-

HTML Div Element Tag - The <div> element in HTML is a generic container used to group together other HTML elements. It's short for "division" and is mostly used for styling (with CSS) or scripting (with JavaScript).

Trulli Trulli

βœ…Basic Example: -πŸ‘‡

<div>
  <h1>Hello, Welcome to our Website!</h1>
  <p>www.learntosap.com</p>
</div>

Hello, Welcome to our Website!

www.learntosap.com


βœ… Example 1: Center Divs Using text-align: center -πŸ‘‡

<!DOCTYPE html>
<html lang="en">
<head>
  <style>
    .container {
      text-align: center;
    }
    .box {
      display: inline-block;
      width: 100px;
      height: 100px;
      background: lightblue;
      margin: 10px;
    }
  </style>
</head>
<body>
  <div class="container">
    <div class="box">Box 1</div>
    <div class="box">Box 2</div>
    <div class="box">Box 3</div>
  </div>
</body>
</html>

Box 1
Box 2
Box 3

βœ… Example 2: Center Divs Grid -πŸ‘‡

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Simple Grid</title>
  <style>
    .grid-container {
      display: grid;
      grid-template-columns: repeat(3, 1fr); /* 3 equal columns */
      gap: 10px; /* space between divs */
      padding: 10px;
    }
    .grid-item {
      background-color: lightblue;
      padding: 20px;
      text-align: center;
      font-size: 20px;
    }
  </style>
</head>
<body>

<div class="grid-container">
  <div class="grid-item">Div 1</div>
  <div class="grid-item">Div 2</div>
  <div class="grid-item">Div 3</div>
  <div class="grid-item">Div 4</div>
  <div class="grid-item">Div 5</div>
  <div class="grid-item">Div 6</div>
</div>

</body>
</html>

Simple Grid
Div 1
Div 2
Div 3
Div 4
Div 5
Div 6

βœ… Example 3: Center Divs Grid in Color -πŸ‘‡

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>HTML Div Grid Example</title>
    <style>
        .container {
            display: grid;
            grid-template-columns: repeat(3, 1fr); /* 3 equal columns */
            grid-gap: 10px; /* Space between grid items */
            padding: 20px;
        }

        .item1 {
            background-color: lightblue;
            padding: 20px;
            text-align: center;
        }

        .item2 {
            background-color: lightgreen;
            padding: 20px;
            text-align: center;
        }

        .item3 {
            background-color: lightcoral;
            padding: 20px;
            text-align: center;
        }

        .item4 {
            background-color: lightgoldenrodyellow;
            padding: 20px;
            text-align: center;
        }

        .item5 {
            background-color: lightpink;
            padding: 20px;
            text-align: center;
        }

        .item6 {
            background-color: lightseagreen;
            padding: 20px;
            text-align: center;
        }
    </style>
</head>
<body>

    <div class="container">
        <div class="item1">Div 1 - Blue</div>
        <div class="item2">Div 2 - Green</div>
        <div class="item3">Div 3 - Coral</div>
        <div class="item4">Div 4 - Yellow</div>
        <div class="item5">Div 5 - Pink</div>
        <div class="item6">Div 6 - Sea Green</div>
    </div>

</body>
</html>

Live Code Preview


May Be Like Important Link-

-Chart Of Account-OB13

-Define Plant-OX1

-Chart Of Account-OB13

-Define Financial Statement