Div
<div> element
The Content Division element (<div>
) is the generic container for flow content.
It has no effect on the content or layout until styled in some way using CSS (e.g. styling is directly
applied to it, or some kind of layout model like Flexbox is applied to its parent element).
As a "pure" container, the <div>
element does not inherently represent anything. Instead, it's used to group
content so it can be easily styled using the class or id attributes.
Example:
Card name
More information
<div class="card">
<h2>Card name</h2>
<p>More information</p>
</div>
.card {
padding: 10px;
border: 2px solid black;
border-radius: 10px;
margin: 10px 0;
}
Read more at MDN Web Docs: The Content Division element