UNIT 10 • STAGE 3 OF 7
Add the illustrated dancer images to each card
Right now each card is a solid dark box with a dance name at the bottom. In this stage you will add an illustrated dancer image inside each card. Because the images are PNGs with transparent backgrounds, the card's own dark color will show through wherever the illustration has no content, creating a clean, layered look.
The image needs to fill the card completely and sit behind the dance name label. To do this, you will position the image absolutely inside the card. The card already has position: relative, which makes it the reference point for anything positioned absolutely inside it.
In Unit 06 you used object-fit: cover to fill a box by cropping a photo. These dancer images are illustrations with transparent backgrounds, cropping them would cut off feet or headdresses. object-fit: contain shows the full illustration, scaled to fit, without cropping anything.
Find the .card-label rule in your CSS and replace it with this updated version, then add the new .dancer-card img rule directly below it:
Inside each .dancer-card, add an <img> tag before the <span>. The image path uses ../../assets/images/ to navigate two folders up from unit-10/ to the project root, then into the assets folder. Here are all six, add the matching <img> to each card:
position: absolute on .dancer-card img, removes the image from normal document flow and positions it relative to the nearest positioned ancestor, which is the card. It fills the entire card area without pushing the label out of position.object-fit: contain, scales the illustration to fill as much of the card as possible without cropping. The full dancer figure stays visible, which matters for regalia, cutting off a headdress or moccasins would lose important detail.object-position: center bottom, anchors the contained image to the bottom center of the card. The dancer's feet sit at the card's base, which feels natural and grounds the figure visually.position: relative; z-index: 1 on .card-label, ensures the dance name text appears above the absolutely positioned image. Without this, the label would be hidden behind the image.background: linear-gradient(...) on .card-label, fades from the card's dark indigo at the bottom to transparent at the top. This creates a readable area for the text without a hard-edged box, so the label blends naturally into the illustration above it.Your grid now shows the six dancer illustrations inside their cards with the dance name readable at the bottom. In Stage 4 you will add the hover effects: the card lifts, the image scales up slightly, and a gold tint overlay fades in when a visitor moves their mouse over a card.