HTML <div>
query_builder | Christopher PisaniThe HTML element <div>, is a section, or how its name states, a division, in the document which holds groups other elements. Although it is not generally visible, with CSS can achieve styles as seen in the example below.
<style>
.warning {
border: 10px ridge #f00;
background-color: #ff0;
padding: .5rem;
display: flex;
flex-direction: column;
}
.warning img {
width: 100%;
}
.warning p {
font: small-caps bold 1.2rem sans-serif;
text-align: center;
}
</style>
<div class="warning">
<img src="https://interactive-examples.mdn.mozilla.net/media/examples/leopard.jpg"
alt="An intimidating leopard.">
<p>Beware of the leopard</p>
</div>
Available Attributes
No specific attributes are assigned for this element, other than the standard global attributes.