CSS Clip Path Shapes
Three ready-made clip-path classes that crop images into a circle, a hexagon and a slanted card.
HTML
<div class="clip-shapes">
<img class="clip-circle" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Crect width='10' height='10' fill='%23f9a8d4'/%3E%3Ccircle cx='7' cy='3' r='1.6' fill='%23fef08a'/%3E%3Cpath d='M0 10V7l3-2 3 2 4-2v5z' fill='%237c3aed'/%3E%3C/svg%3E" alt="Circle-cropped sunset" width="80" height="80">
<img class="clip-hexagon" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Crect width='10' height='10' fill='%23f9a8d4'/%3E%3Ccircle cx='7' cy='3' r='1.6' fill='%23fef08a'/%3E%3Cpath d='M0 10V7l3-2 3 2 4-2v5z' fill='%237c3aed'/%3E%3C/svg%3E" alt="Hexagon-cropped sunset" width="80" height="80">
<img class="clip-slant" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Crect width='10' height='10' fill='%23f9a8d4'/%3E%3Ccircle cx='7' cy='3' r='1.6' fill='%23fef08a'/%3E%3Cpath d='M0 10V7l3-2 3 2 4-2v5z' fill='%237c3aed'/%3E%3C/svg%3E" alt="Slant-cropped sunset" width="80" height="80">
</div>
CSS
.clip-shapes {
display: flex;
gap: 14px;
}
.clip-shapes img {
display: block;
width: 80px;
height: 80px;
object-fit: cover;
transition: clip-path 0.4s ease;
}
.clip-circle {
clip-path: circle(50%);
}
.clip-hexagon {
clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
}
.clip-slant {
clip-path: polygon(0 0, 100% 12%, 100% 100%, 0 88%);
}
.clip-shapes img:hover {
clip-path: inset(0 round 12px);
}
@media (prefers-reduced-motion: reduce) {
.clip-shapes img {
transition: none;
}
}
About this CSS Clip Path Shapes
This CSS Clip Path Shapes is 34 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses transitions, clip paths, Flexbox and reduced-motion support. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.
CSS features used
How to use this clip path shapes
- Copy the HTML and paste it where you want the element to appear.
- Copy the CSS into your stylesheet, or inside a
<style>tag. - Keep the
.clip-shapesclass name, or rename it in both places. Then tweak colors, sizes and timing to match your design. - Using React or Next.js? Change
classtoclassNamein the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).
Building with an AI tool?
“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.