CSS Triangle Generator
NewDeveloperGenerate a border-based CSS triangle in eight directions with your size and color. Copy the ready-to-use CSS in one click. Free and no images needed.
Direction
CSS code
.triangle {
width: 0;
height: 0;
border-left: 40px solid transparent;
border-right: 40px solid transparent;
border-bottom: 80px solid #6366f1;
}The triangle is drawn with CSS borders only — no images or SVG. Paste the code into your stylesheet and apply the .triangle class.
How does a CSS triangle work?
A triangle is created with borders on an element that has zero width and height. Each edge is a transparent border except one, and the visible border forms the triangle shape.
Which directions are supported?
Eight directions: up, down, left, right and the four diagonals. Every option produces pure CSS — no images, SVG or extra elements needed.
Can I change size and color?
Yes. The size slider sets the base dimension in pixels and the color picker controls the triangle color. The generated code and the preview update in real time.
How do I use the generated code?
Copy the CSS block and paste it into your stylesheet. Apply the .triangle class to an empty element and the triangle appears exactly as previewed.
Does it work on all browsers?
Yes. Border techniques are supported by every modern browser and have been a standard trick in CSS for years — no fallbacks required.
Frequently Asked Questions
What is CSS Triangle Generator?
Create a pure CSS triangle with a chosen direction, size and color.
How do I use CSS Triangle Generator?
Type or paste your data into the field on this page and press the button. The result is calculated instantly in your browser — nothing is uploaded.
Is CSS Triangle Generator free?
Yes, CSS Triangle Generator is completely free. No signup, no downloads and no usage limits.
Similar tools
View all toolsPopular tools
View all toolsWant to share what you created? Try linklyhub.com for a short, clean link.