InputTestHub

CSS Triangle Generator

Creates triangles and arrows in pure CSS using the border trick, in any direction, size and colour.

Colour & Design Nothing uploaded No sign-up Free, unlimited
Colour & Design tool
Fill in the fields and press Generate.
In short A CSS triangle is made from borders, and once you see why it works you can never unsee it. Give an element zero width and height and thick borders, and the four borders meet each other at 45° diagonals — so each border is already a triangle. Make three of them transparent and colour the fourth, and what is left is a single triangle pointing away from the coloured side. Change which border is coloured to change the direction; make the two side borders unequal to skew it. The trick predates every modern alternative and is still the most compatible way to draw a tooltip arrow, a dropdown caret or a ribbon end without an image. Two things worth knowing before using it. The triangle is made of border, so it cannot take a gradient, a border of its own, or a border-radius — if you need any of those, `clip-path: polygon()` is the modern approach and is well supported now. And because the element has no width or height, it will not respond to `width` at all: the size comes entirely from the border widths, which is why resizing one feels unintuitive until you know where the dimensions actually live.

How to use the CSS Triangle Generator

  1. Fill in the fields with your own details.
  2. The generated code updates live in the output panel.
  3. Copy the code and paste it into your page, file or CMS.

About the CSS Triangle Generator

The CSS Triangle Generator creates triangles and arrows in pure CSS using the border trick, in any direction, size and colour. It runs as plain JavaScript inside the page, which means there is no upload step, no queue and no size limit imposed by a server — the only limit is your own device.

What people use it for

  • Making a tooltip or speech-bubble arrow.
  • Adding a chevron without an icon font.
  • Building a CSS-only pointer.

Frequently asked questions

Does the CSS Triangle Generator cost anything?
No charge and no sign-up. There is no free tier to run out of because there is no paid tier — inputtesthub.com is funded by advertising rather than by metering the page.
Is the CSS Triangle Generator safe to use with private information?
No. The CSS Triangle Generator runs entirely in your browser using JavaScript. Your input never reaches inputtesthub.com or any third party — open your browser's Network tab while you use it and you will see no request go out.
When would I actually need the CSS Triangle Generator?
In practice it gets used for three things: making a tooltip or speech-bubble arrow. Adding a chevron without an icon font. Building a CSS-only pointer. It is built for exactly those cases rather than being a general-purpose tool with this bolted on.
Is there an app version?
Yes. The page is responsive and the page works in Chrome, Safari, Firefox, Edge and Samsung Internet on both Android and iOS. There is no app to install and nothing to sign into.

Related colour & design tools

All 33
01

CSS Gradient Generator

Builds linear, radial and conic CSS gradients with multiple stops, live preview and copyable…

02

Box Shadow Generator

Builds CSS box shadows with multiple layers, live preview and copyable output including inset…

03

Text Shadow Generator

Creates CSS text shadows including outline, emboss, neon and long-shadow effects.

04

Border Radius Generator

Builds CSS border-radius including per-corner and elliptical values, with a live preview.

06

Neumorphism CSS Generator

Generates soft-UI shadows where an element appears extruded from or pressed into the background.

07

Cubic Bezier Generator

Builds CSS easing curves with a draggable preview and a library of standard easings.

08

CSS Filter Generator

Builds CSS filter chains — blur, brightness, contrast, grayscale, hue-rotate, invert…

09

CSS Transform Generator

Builds CSS transforms — translate, rotate, scale, skew and 3D perspective — with a live preview.

10

Flexbox Generator

Builds flexbox layouts visually and outputs the CSS, with every alignment and wrapping option…