<div> HTML Tag

In this article I will discuss the div tag of HTML.
  • 1693

The HTML div tag is used for defining a section of your document. With the div tag, You can group large sections of HTML elements together and format them with CSS. For example, you could have your navigation section wrapped in one div and your main content section in another div.

Example

<html>

<head>

    <title></title>

</head>

<body>

    <div style="border: 2px solid blue; color: Red; background-color: yellow">

        Hi!This is a Header section!!!!!</div>

    <br />

    <div style="border: 5px dotted blue; height: 120px; color: Purple; background-color: Gray">

        This is a content section!!!!!</div>

    <br />

    <div style="border: 2px solid blue; color: Red; background-color: Aqua">

        Hi!This is a Footer section!!!!!</div>

    <br />

</body>

</html> 


Output
 

Hi!This is a Header section!!!!!

 
This is a content section!!!!!

 
Hi!This is a Footer section!!!!!

Ask Your Question 
 
Got a programming related question? You may want to post your question here
 
© 2019 DotNetHeaven. All rights reserved.