Grouping Tags

Next ❯List Tags

This Tags are used to group the elements (via <div> tag) or words inside the elements (via <span> tag)

  • Used to provide some features in a group like styling
  • Tags are: <span>, <div>
Tag:
  • label_outlineDivision Tag <div>
    <!DOCTYPE html>
    <html>
      <head><title>Division Tag Example</title>
      <style type="text/css">
        p { color:black; }
      </style>
      </head>
      <body>
        <div style="background-color:#26a69a;color:white;text-align: center;">
            <h4>The First division</h4>
            <p>This is the paragraph of first division</p>
              <div style="background-color:#f06292;margin: 10px;">
                  <h5>The devision inside First division</h5>
                  <p>This is the paragraph of nested first division</p>
              </div>
            <p>This is the 2nd paragraph of first division</p>
        </div>
        <div style="background-color:#e0e0e0;color:#5c6bc0">
            <h4>The second devision </h4>
            <p>This is the paragraph of Second division</p>
        </div>
      </body>
    </html>
    • It defines a division or a section in an HTML page
    • you can style individual sections or division as per your requirement
    • you can create division inside division in an HTML page (Nested)
    • Output Below

    Output:

    The First division

    This is the paragraph of first division

    The devision inside First division

    This is the paragraph of nested first division

    This is the 2nd paragraph of first division

    The Second devision

    This is the paragraph of Second division

  • label_outlineSpan Tag <span>
    <!DOCTYPE html>
    <html>
      <head><title>Span Tag Example</title></head>
      <body>
      <p> I love <span style="color:red;">RED</span>, <span style="color:blue;">BLUE</span>,
       <span style="color:green;">green</span> colors, <br> 
       <span style="color:purple;">all this word are in purple color</span></p>
      </body>
    </html>

    Output:

    I love RED, BLUE,GREEN colors,
    All this word are in purple color

    • It's used to style the group of inline-elements in a web page
    • or can say, To style words or group of words in an element
  • Note! The "style" Attribute is a part of CSS(Design)
Browsers Supports
SafariMicrosoft EdgeMozilla FirefoxChromeOpera Mini

Click on the above icon to see the name of the browser !

  • Tips! Always try to use latest version of browser

  • List Tags
❮ Prev Link Tag
Next ❯List Tags
TryOut Examples"Learn to Explore..!"

TryOut Editor

receipt