Modern Shaped Cutouts

CSS masking is an incredibly powerful layout technique. Learn how to implement beautiful, scalable shapes for arbitrary images, safely design custom shapes for text components, or use pure CSS gradients.

1. Arbitrary Image Masking

The SVG mask is applied directly to the image element. The mask scales automatically to the shape bounds using objectBoundingBox. Hover to see scale and tone animations.

User Profile Portrait Minimalist Building Architecture

2. Text-Bearing Card Masking

Applying a mask to the text element directly would crop your content. Instead, we mask an empty div placed adjacent to the text block. Sharing the same background color makes them look like one unified shaped card.

Ultra-Creative Space

Building robust responsive design patterns using modern web platform APIs.

3. Pure CSS Gradient Cutout

For simple shapes, you can define linear or radial gradients directly in CSS. The dot pattern background shines right through the transparent semi-circular notch cut out along the top edge.

Notched Coupon

The background pattern is visible through the top notch, created using a single CSS radial-gradient.