<div> tag

HTML <div> tag

The <div> tag helps to create the layout of the Web Page by dividing an area into sections or divisions.

This tag is one of the most important tag to group other tags. So it acts as a container for other tags.

You can apply CSS to style this element.

<div>Can  Include Multiple tags</div>


<div style ="background-color:black;color:LightGreen;">
    <h4>Month Jan-Apr</h4>
<div style ="background-color:black;color:LightGreen;">
    <h4>Month May-Aug</h4>
<div style ="background-color:black;color:LightGreen;">
    <h4>Month Sep-Dec</h4>

CSS Default Value

display: block;

How Browser will display

BLOCK Level.

Difference between HTML4.01, XHTML and HTML5

No difference No difference In HTML5, the <align> attribute is deprecated when it is used with the <div> tag.

Attributes used with <div> tag

Attribute Description
width Sets the width of the div.
height Sets the height of the div.
align To align the content inside the <div>.
(HTML5 does not support this attribute when it is used with the <div> tag).

Global Attributes

The <div> tag supports Global attributes.

Event Attributes

The <div> tag supports Event attributes.

Supporting Browsers

supporting-browsers for tags

Related Tags

<section> , <span> , <header> , <footer> , <article> , <summary> & <nav> tags

Tutorials for all brains!