CSS TOOLS · BFOTKIT
CSS Triangle Generator | BFOTKit
Point triangles in any direction with a chosen size and color and copy the classic zero-size border CSS — no images, no SVG.
Everything is generated locally in this browser tab. Nothing is sent to a server.
GUIDE
How the CSS triangle works
The border trick explained
A CSS border is drawn as four trapezoids meeting at the middle. On an element with zero size and thick borders, setting three borders to transparent leaves one visible trapezoid — a triangle. The generator writes exactly that.
Point it anywhere
The eight directions cover the common cases: four cardinal directions for tooltips and arrows, four diagonals for corner markers. Width and height control the triangle shape; equal values give a right-angle look, differing values an isosceles.
Use it inline, size it in em
Placing the snippet inside a button or label inherits font size, so defining width and height in em keeps the arrow proportional to the text next to it.
HELP / FAQ
Triangle generator questions
Why not just use an SVG?
You can — SVG is more readable. The border trick wins when you want zero extra requests and the shape to inherit color via currentColor. Both are valid; this tool serves the CSS-native route.
Can the triangle have a border of its own?
Not directly. Layer two triangles — a slightly larger one behind in the border color and the inner one in the fill color — to fake an outlined arrow.
Does it work in flexbox or grid?
Yes. The element is a normal box with zero content size; alignment properties position it like any other inline item.
Why do I see a thin line artifact?
Some browsers antialias diagonal border edges faintly. Slightly overlapping the triangle with its parent background, or using a 0.5px offset, hides the artifact.