Get Website Learn Coding Tech Story

HTML Examples



Html <div> Element


The <div> tag is nothing more than a container unit that encapsulates other page elements and divides the Html document into sections. Web developers use <div> elements to group together Html elements.





<div> example

<div name="thisdiv" title="Example of div element">


 <h1>Heading</p>


 <p>This a paragraph</p>


</div>









Html <div> inside <div>


The <div> inside <div> elements helps to create subdivide to create different kind of layout in a web document. This concept is the foundation of which most web pages are now built. Html documents that are properly divided and subdivided are easy to maintain and modify.





<div> example

<div name="maindiv" title="Example of maindiv element">


 <div name="subdiv" title="Example of subdiv element">


   <h1>Heading</p>


   <p>This a paragraph</p>


 </div>




 <div name="subdiv" title="Example of subdiv element">


   <h1>Heading</p>


   <p>This a paragraph</p>


 </div>


</div>