To create a box with shadow using CSS, apply the box-shadow property to a <div> element. First, define the box’s width, height, background color, and padding. Then add a shadow to give it a raised appearance.
For example:
.box {
width: 250px;
padding: 20px;
background: white;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
The first two values control shadow position, while the third sets blur intensity. You can adjust these values to create subtle or stronger shadows for website cards, content boxes, and other interface elements.