Work Sample Card

Create a visually striking portfolio grid with this image-centric card for showcasing your work samples.

This component is designed to be highly scannable, making it perfect for the main page of a portfolio. It overlays the project's title and key skills/technologies directly onto the cover image, keeping the focus on the visuals.

Screenshot of portfolio cards with text and tags overlaid on images.

Get Source Code Preview

About this Component

This card template makes the project's cover image the entire background of the component. A CSS gradient is applied to the bottom portion of the image to create a semi-transparent dark area, which ensures that the overlaid white text is always clear and legible. On hover, the image subtly zooms in to provide an engaging interactive cue.

Features

Code Breakdown

HTML Structure

Each card is a single a tag with the class .work-sample-card, making the entire component clickable by default. Inside this link, the project's cover img is the first element, followed by a div for the content overlay. This overlay contains the project's h3 title and a final div that holds the list of tags.

CSS Styling

The main anchor tag (.work-sample-card) is a flex container that uses justify-content to push the content overlay to the bottom of the card. It is also set to position: relative to act as the positioning context for its children. The image (.work-sample-image) is positioned absolutely with a z-index of 0 to fill the entire background. The content div is also set to position: relative with a z-index of 1, which layers it on top of the background image, making it visible. This `div` has a linear-gradient() background, which creates the semi-transparent scrim effect for the text.

Code

Here's the complete, self-contained code. Simply replace the images and text to build your portfolio grid.

View Output