CSS Triangle Generator

Build a pure CSS triangle or arrow from borders and copy the finished rule.

Build a triangle

Borders: —
Box: — · outline: —
One coloured border and two transparent borders draw the triangle from a zero size box. The outline is a smaller triangle of the fill colour placed inside it.

How to use the CSS Triangle Generator

  1. Choose the direction and pick a triangle or an arrow.
  2. Set the half width, the outline thickness and the two colours.
  3. Copy the generated rule and rename the triangle class to match your markup.

Features

Advertisement

Frequently Asked Questions

Common questions about the free online css triangle generator.

A box with no width or height and three thick borders draws a triangle, because two transparent borders cut away everything except one corner.
Give the box a coloured top border and make the left and right borders transparent, which leaves a triangle pointing towards the bottom.
Draw a second, slightly smaller triangle of the fill colour inside the outer one, which is what the outline option writes for you.
It is one and a half times the half width, so the shape stays close to an equilateral triangle at every size.
Add a rectangular shaft next to the triangle. The arrow option writes a container for the shaft and a pseudo-element for the head.
One of the transparent sides is probably missing. All three borders must be present, two of them transparent, for the corner to show.
Yes. Position the triangle absolutely against the tooltip box, with the matching direction, and give the tooltip a matching background.
Yes. It is completely free, runs locally in your browser and needs no account, no sign-up and no upload.

Last updated: October 10, 2026