Home › Forums › Growing Hemp › How to Create a Box with Shadow Using CSS?

1 voice, 0 replies
  • ankitrajput
    Participant
    @ankitrajput
    #21040

    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.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.