CSS Triangle Generator

Build a pure-CSS triangle in any direction and copy the border rules.

Tool Panel

Processed locally
Loading tool...
About CSS Triangle Generator

Eight orientations drawn with CSS borders alone — no images and no SVG in the output.

  • 1

    It builds the triangle from **mitred borders**: `width: 0; height: 0` plus two transparent borders and one solid one — the solid border faces away from where the triangle points (a triangle pointing up uses `border-bottom`).

  • 2

    The four diagonal directions use one solid and one transparent border, letting the 45° mitre line cut a right angle, which lands on the solid side (hence the names: `topLeft` means the right angle sits top-left).

  • 3

    Base, height and colour are adjustable, and the declarations feed both the preview and the code block — one source, so the two cannot drift apart.

Related tools

View all
Design Tools

Color Picker

Pick a colour and read off its HEX, RGB and HSL values.

Design Tools
Design Tools

Contrast Checker

Check foreground and background contrast against accessibility thresholds.

Design Tools
Design Tools

Gradient Generator

Build CSS linear and radial gradients visually, then copy the code.

Design Tools
Design Tools

Box Shadow Generator

Tune a box shadow visually and copy the CSS.

Design Tools

Unit Converter

Convert physical units across length, weight, volume and more.

Design Tools
Design Tools

Bytes Converter

Convert between bytes, KB, MB, GB and TB.

Design Tools
Design Tools

Border Radius Generator

Tune each corner visually and copy the CSS border-radius.

Design Tools

Clip Path Generator

Drag the points to shape a polygon and copy the CSS clip-path.