Gallery of Skewed Images with Hover Effect

December 02, 2025

Another classic component made easy with modern CSS and the new corner-shape. A gallery of skewed images with a reveal effect on hover using a few lines of code. The skewing adjusts accordingly to the direction of the text. Another direction-aware shape!

CSS-only gallery of skewed images

.gallery { --s: 50px;  display: flex; gap: 10px;}.gallery > img { flex: 1; border-start-start-radius: var(--s) 100%; border-end-end-radius: var(--s) 100%; margin-inline-end: calc(-1*var(--s)); corner-shape: bevel; transition: .3s linear;}.gallery > img:hover { flex: 1.6;}.gallery > img:is(:first-child,:hover),.gallery > img:hover + * { border-start-start-radius: 0 100%;}.gallery > img:is(:last-child,:hover),.gallery > img:has(+ :hover) { border-end-end-radius: 0 100%; margin-inline-end: 0;}

Another implementation using clip-path with better, support but not direction-aware.

trang chủ - Wiki
Copyright © 2011-2025 iteam. Current version is 2.148.2. UTC+08:00, 2025-12-12 17:58
浙ICP备14020137号-1 $bản đồ khách truy cập$