HTML <div> tag
When writing in HTML, the <div> tag is a block element used to divide or section off content on a web page. It is useful for grouping block-level elements together so they can be formatted simultaneously using CSS. The following sections contain information about this tag including an example of it in use, as well as related attributes and browser compatibility.
Example of <div> code
<div style="color:#ff9900; border-style:solid; border-width:2px; border-color:black;">
<h3>This content is in its own <div> element</h3>
<p>You can put any element into a div, which is excellent.</p>
Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. Every attribute unique to the <div> tag is deprecated, meaning that it may function currently, but is not supported in going forward. In this case, CSS should be used in place of this attribute.
|align||Designates the alignment of the content within a <div>|
|All versions||All versions||All versions||All version||All versions||All versions|