+ 1

What is the use of div tag?

25th Jul 2017, 1:53 PM
Srinivas Chanti
Srinivas Chanti - avatar
3 Answers
+ 7
it defines a section in an html document
25th Jul 2017, 2:07 PM
Nomeh Uchenna Gabriel
Nomeh Uchenna Gabriel - avatar
+ 5
@2_3rr0r5, The <div> tag is not a rectangle, it only took the shape of the document. refer to svg/canvas[rect].
25th Jul 2017, 2:23 PM
Nomeh Uchenna Gabriel
Nomeh Uchenna Gabriel - avatar
0
The "div" tag creates a division, which is a rectangle you can resize by using width and height, add border, padding, margin and all style you want. It'll be refered to only that division... @Nomeh Uchenna Gabriel take it easy, it was just to make him understand. normally, if you add a border it's drawn as a rectangle containing something, that's all! <!DOCTYPE html5> <html lang="en"> <head> <title> Div representation </title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> div { border-style:solid; border-color: red; padding: 30px; width:200; background-color: black; color:white; } </style> </head> <body style="background-color:blue;"> <div> This is a div, don't you see a rectangle? </div> </body> </html>
26th Jul 2017, 10:12 AM
2_3rr0r5
2_3rr0r5 - avatar