ش | ی | د | س | چ | پ | ج |
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
https://www.w3schools.com/tags/tag_div.ASP
A section in a document that will have a light blue background color:
<div style="background-color:lightblue">
<h3>This is a heading</h3>
<p>This is a paragraph.</p>
</div>
The <div> tag defines a division or a section in an HTML document.
The <div> element is often used as a container for other HTML elements to style them with CSS or to perform certain tasks with JavaScript.
Element | |||||
---|---|---|---|---|---|
<div> | Yes | Yes | Yes | Yes | Yes |
Tip: The <div> element is very often used together with CSS, to layout a web page.
Note: By default, browsers always place a line break before and after the <div> element. However, this can be changed with CSS.
The align attribute not supported in HTML5.
Attribute | Value | Description |
---|---|---|
align | left right center justify |
Not supported in HTML5. Specifies the alignment of the content inside a <div> element |
The <div> tag also supports the Global Attributes in HTML.
The <div> tag also supports the Event Attributes in HTML.
HTML tutorial: HTML Blocks
HTML tutorial: HTML Layout
HTML DOM reference: Div Object
Most browsers will display the <div> element with the following default values:
div {
display: block;}