<div> tag in HTML
The <div> tag is used to defines a section in an HTML document. The <div> tag very useful to layout a web page.
Important Description
- The browsers always place a line break before and after the <div> element by default.
- The <div> tag is used by web developers to group HTML elements together and apply CSS styles or JavaScript to many elements at once.
- Open and close tag required of <div>.
Example of <div> tag
Result Look Like
This is div heading
This is paragraph of div element.
<div> Tag Browser Support
Element |
Chrome |
Edge |
Firefox |
Safari |
Opera |
<div> |
Yes |
Yes |
Yes |
Yes |
Yes |
Global Attributes
Event Attributes
DIV Attributes
Attribute |
Value |
Description |
align |
left
right
center
justify |
Specifies the alignment of the content inside a <div> element. (Not supported in HTML5) |