Articles → HTML → Div Tag In HTML

Div Tag In HTML






Purpose





Syntax


<div>
      Contents 
</div>



Example


<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
    <div style="border:1px solid black;height:25%">
        Test1
    </div>
    <div style="border:1px solid black;height:25%">
        Test2
    </div>
    <div style="border:1px solid black;height:25%">
        Test3
    </div>
    <div style="border:1px solid black;height:25%">
        Test4
    </div>
</body>
</html>

Try It






Output


Picture showing the output of div tag in html



Browser Support


Internet ExplorerFirefoxChromeSafariOperaEdge
YesYesYesYesYesYes



Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, November 1, 2016
 
Updated On  -  Saturday, November 18, 2017

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250