FreeDev Tools

CSS Triangle Generator

Generate pure-CSS triangles with the border trick β€” any direction, size, and color.

.triangle {
  width: 0;
  height: 0;
  border-left: 40px solid transparent;
  border-right: 40px solid transparent;
  border-bottom: 80px solid #3b82f6;
}

Generated locally in your browser β€” nothing is uploaded.

How to Use

  1. 1

    Pick a direction

    Four sides or four corners.

  2. 2

    Set size and color

    Width, height, and fill color sliders.

  3. 3

    Copy the rule

    Zero-size element with the border trick applied.

Frequently Asked Questions

A zero-size element's borders meet at diagonals, so making three borders transparent and one colored leaves a triangle. Direction and proportions come from which borders you size β€” the generator does the arithmetic.