create a slanted edge #css
✓ Published0🌍 Public
TTimeBandit
Last edited Sep 29, 2018
Created on Sep 29, 2018
This example demonstrates how to create a slanted edge on a hero section using only CSS. The hero element displays a purple gradient background, with a pseudo-element (`#hero:after`) that inherits the background and applies a `skewY(-1.5deg)` transform to slice the bottom edge diagonally. The code relies on the CSS `linear-gradient` property for the visual styling, `position: relative` and `z-index` for layering, and the `transform` and `transform-origin` properties to achieve the angled cut. The effect is purely presentational, requiring no JavaScript or external libraries.
AI-generated description