Create a triangle shape with 2 CSS properties
Creating a basic triangle shape is as simple as using two CSS properties
aspect-ratio
clip-path
(with a 3-point polygon)
That's it, and it works with any kind of elements including images.
Get the CSS code from: css-generators.com/triangle-shapes
More CSS Tips
- Be careful when using the nesting selector (&) The "&" selector is not the same in CSS and Sass so use it carefully.
- Heart shape with a sliding hover effect II A lovely animation to your heart shape image.
- When to use the min() or max() function a quick trick to know when to use min() or max().
- An infinite number of borders around images A border-image trick to add as many number of borders as you want.