Controls
Preview
How to Use
- Select the direction the triangle should point using the dropdown.
- Adjust the size of the triangle using the slider or number input.
- Choose the color of the triangle using the color picker.
- Optionally, change the background color for better preview contrast.
- The preview will update automatically.
- The generated CSS code for a `.triangle` class will appear below.
- Click "Copy CSS" to copy the code.
Note: This technique uses transparent borders on adjacent sides to create the triangle shape.
Why Use CSS Triangles?
- Pure CSS Shapes: Create tooltips, pointers, and other UI elements without using images.
- Lightweight: No extra HTTP requests needed for images.
- Scalable & Customizable: Easily change size and color via CSS.
- Performance: Generally performant for simple shapes.