description & Usage
<div> is used as a container to group other elements and contents. It divides theHTML document into different sections.
Browsers insert a line break both before and after the <div> element, meaning it's a block-level element by default.
<div> tags are used to logically divide sections of a web page. They don't have any meaning on their own.
You can use the <span> tag for <style="color: #2dc26b;">inline level division.
Browser compatibility and Support
# | Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
<div> |
Global Attributes
The <div> tag supports the HTML Global Attributes.
Event Attributes
The <div> tag supports the HTML Event Attributes.
Default CSS
Most browsers will display the <div> tag with the following default style: