The div tag (<div> </ div>) is a very important HTML tag. The section (HTML) is created inside the HTML element. The number of div divisions A <div> </ div> element acts as a container for all elements within it.

There is no div to make layout. Tables usage for HTML layout has come to zero, for various reasons. And so div is an integral element of layout now.

<div style="border:1px solid #f00">
<h1>HTML div tutorial</h1>
<p>Basically div layout designed by CSS</p>

</div>
<div style="border:1px solid #f00">
<h1>HTML div tutorial</h1>
<p>Basically div layout designed by CSS</p>

</div>

After writing the code in the div, it is given the necessary shape with CSS. These will be discussed in the CSS tutorial.

Just know here div is an element like another HTML element. It’s block level element. An attribute named align can be used, but the HTML 5 is deprecated, actually all the functions of the align attribute can be done with CSS or

Here we have written inline CSS (style = “border: 1px solid #ddd”), so you can create beautiful layouts with CSS.

<div style="float:left;background:yellow;width:100%;">
<ul>
<li>item1</li>
<li>item 2</li>
</ul>
</div>
<div style="border:1px solid #f00; float:left ;width:48% ">

<h1>HTML div tutorial</h1>

<p>Basically div layout designed by CSS</p>

</div>

<div style="border:1px solid #f00; float:left;width:48%;margin-left:5px">

<h1>HTML div tutorial</h1>

<p>Basically div layout designed by CSS</p>

</div>
<div style="background:#000;width:100%;float:left;color:#fff;text-align:center;">
Copyright &copy; ashik.pw
</div>

You can use global (eg id, class, style, dir etc) and event attributes (such as onmouseover, dblclick etc) in the div.