CSS triangle generator

A CSS triangle is a zero-size element with one coloured border and two transparent neighbouring borders.

Features

  • Four directionsUp, down, left and right.
  • Any sizeWidth and height separately.
  • Runs in your browserNothing is uploaded and no account is needed.

How to use the css triangle

  1. Choose direction and size.
  2. Pick a color.
  3. Copy the CSS.

An alternative

clip-path: polygon() can draw triangles that keep their backgrounds and gradients.

Frequently asked questions

Where is it useful?

Tooltip arrows and dropdown indicators.

Can it have a shadow?

box-shadow will not follow it; use filter: drop-shadow().

Why is width zero?

The shape is made entirely from borders.

Related tools