+ 3

what is function of div??

19th Jul 2016, 10:44 AM
Muhammad Arslan Shahid
Muhammad Arslan Shahid - avatar
3 Answers
+ 4
The <div> tag defines a division or a section in an HTML document. The <div> tag is used to group block-elements to format them with CSS. <div style="color:#0000FF"> <h3>This is a heading</h3> <p>This is a paragraph.</p> </div>
19th Jul 2016, 11:54 AM
Mahima Rajvir Singh
Mahima Rajvir Singh - avatar
+ 2
think of a div element as a catch all of elements. it is used with a style rule in CSS. the CSS element would start with a #. and in the html would be written like a class. #container { border: solid thick black; border-radius: 25px; background-color: blue; } <div id="container"> <h1></h1> <P></p> </div><!--end of container--> this will make it so everything withing the div syntax withh have all of the properties of the CSS style rule.
6th Aug 2016, 10:16 PM
Robin Jennings
Robin Jennings - avatar
+ 1
the div (tag defines a section in a document). document like css, js, and other file's. to know you how its works. i have created a code for you. which defines how its works... just copy the code and run it on code playground... i think that with my code and suggestion you will now know. what is div tag and what its use for?? here's the code: <div class="test"><h1>testing div tag function</h1></div> <style> .test { color:red; border:3px black solid; padding:1px; background:blue; } </style>
19th Jul 2016, 1:39 PM
Faizan
Faizan - avatar