CSS Triangle Generator
Generate pure CSS triangles using the border property hack.
Configuration
Width
100px
CSS Code
width: 0; height: 0; border-style: solid; border-width: 0 50px 100px 50px; border-color: transparent transparent #3b82f6 transparent;
CSS Triangle Generator
The CSS Triangle Generator helps you create triangle shapes using pure CSS. This technique relies on the way browsers render borders when they meet at corners.
How it works
By setting an element's width and height to 0 and applying thick borders, you can create triangles. The transparent borders create the angled sides, while the colored border creates the visible triangle.
Common Uses
- Tooltips: Create the little arrow pointing from a tooltip to its target.
- Dropdowns: Indicate that a menu can be expanded.
- Breadcrumbs: Separate navigation items.
- Decorative Elements: Add geometric flair to your design.