Loona Automation logoLoona Design Studio
Home › Design Tools › CSS Triangle Generator

CSS Triangle Generator — Border-Trick Triangles in Four Directions

In short: the CSS Triangle Generator produces the famous border-trick triangle — a zero-size element whose thick borders meet as a perfect arrow — in four directions, any size and colour.

Tooltips, carets, play buttons and speech-bubble tails are all this one trick. Learn it once here and you will see it everywhere.

Private by design: everything in this tool happens 100% in your browser with JavaScript. Your data, photos and designs are never uploaded to a server, never stored and never seen by us - close the tab and everything is gone.

How to use the CSS Triangle Generator

  1. Choose the direction the triangle points.
  2. Set size (the full height of the arrow) and colour.
  3. Copy the CSS — the element needs no content, just the class.

How it works

A 0 × 0 element’s borders are four triangles meeting at the centre. Making three borders transparent and one coloured leaves a single triangle; border widths control its proportions (the side borders are half the main size for an isoceles arrow).

Worked example

A FAQ accordion’s little ▼ caret, previously an image, becomes six lines of CSS from here — one less file on every page load.

Frequently Asked Questions

Why use CSS triangles instead of an image or emoji?

They scale, recolour with one value, load instantly and stay sharp — and they inherit theming (dark mode) automatically.

Can I make a corner ribbon triangle?

Yes — the right-angle case is two borders coloured; start from the copied pattern and zero one more width.

Does it work for tooltips?

Perfectly — position the triangle at the tooltip edge; it is the standard technique.

Is the output standard?

Yes — plain border CSS, supported since forever.

More Colour & CSS Generators

The visual Color Palette Generator and the basic Gradient Generator live in Loona Image Tools; this family is the CSS-developer-grade set (multi-stop gradients, exact code output).

Embed this tool on your website — free

Add this tool to your own website or blog — it is completely free, needs no sign-up, and always shows the latest version. Copy the code below and paste it into your page where you want the tool to appear. Keeping the small “Powered by Loona Automation” credit line under the embed helps keep this tool free — but you are free to style or remove it; the tool works either way.