1. Home
  2. Design tools
  3. CSS Triangle & Tooltip Arrow Generator

CSS Triangle & Tooltip Arrow Generator

Draw a triangle with CSS alone, or add an arrow to a tooltip, without images.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use CSS Triangle & Tooltip Arrow Generator

  1. Choose triangle or tooltip arrow.
  2. Pick direction, size and color.
  3. Copy the CSS.

Features

  • Eight directions including corner triangles
  • Border method and clip-path method
  • Tooltip arrow on any side
  • Arrow size and position along the edge
  • Live preview
  • Copy-ready CSS

Supported formats

Input

  • Size, color and direction

You get

  • CSS

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the CSS Triangle & Tooltip Arrow Generator is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • Border triangles cannot take gradients; use the clip-path method for that.
  • Clip-path triangles clip shadows and outlines.

Guide

CSS triangles and tooltip arrows without images

Speech bubbles, dropdown carets, breadcrumb arrows and tooltip pointers all need a small triangle, and reaching for an image or an icon font for it is overkill. CSS can draw one with no assets at all, in two ways. This page generates both, for eight directions, plus a ready tooltip with an arrow, so you can paste the rule straight into a stylesheet.

The border method

Give an element a width and height of zero and the borders around its empty box meet at the corners in diagonal joins. Each border is a trapezoid that collapses to a triangle when the box has no size. Make three borders transparent, give one a colour, and only that triangle shows. For a downward arrow of 40 by 24 pixels the page writes border-left: 20px solid transparent;, border-right: 20px solid transparent; and border-top: 24px solid #ef4f2b;. The side borders are half the width each, the coloured border is the height. The arrow points away from the coloured border, which is why a border-top makes it point down.

A worked example

Press Sample for exactly that red down arrow: direction down, width 40, height 24, colour #ef4f2b, border method. Switch the method to clip-path and the same shape is written as width: 40px; height: 24px; background: #ef4f2b; clip-path: polygon(0 0, 100% 0, 50% 100%);. The polygon lists the top left, the top right and the bottom middle. The two versions look the same on screen. A diagonal direction needs only two borders: an up-left corner at 60 by 40 is border-top: 40px solid #6366f1; with border-right: 60px solid transparent;.

Choosing a method

Borders work in every browser and take no extra layout, but the element has no real size, so a gradient background, an image or text cannot fill it. Clip-path keeps a normal box, so it can have a gradient or a pattern and its dimensions are plain width and height. It cuts the element’s drawing, so a box-shadow or a border outside the shape is clipped away too; for a shadow, wrap the element and use filter: drop-shadow() on the wrapper.

Tooltip arrows

Switch to the Tooltip arrow tab. The box gets position: relative, and the arrow is a ::after pseudo-element with position: absolute, a border of the chosen size and a single coloured side. With the arrow on the bottom edge and a size of 8 the page writes top: 100%; left: 50%; margin-left: -8px; and border-color: #1f2937 transparent transparent transparent;. The negative margin pulls the arrow back by its own half width so that it is centred on the chosen point; the position slider moves that point along the edge between 5% and 95%.

Edge cases

Triangles blur slightly on fractional device pixels, so choose even widths when the arrow has to be crisp. A tooltip arrow needs a box with an explicit background; the page uses the same colour for both so the pointer appears to grow out of the box. If the tooltip sits on a border, add the border to the arrow as a second, slightly larger triangle behind it.

Limits

The page generates the shapes and the pointer geometry. It does not position the tooltip near its target, choose the side automatically when it runs out of room, or handle focus and hover, which belong to your script. Everything is created in your browser.

Checked against the current version of the CSS Triangle & Tooltip Arrow Generator on .

Troubleshooting

The download did not start

Look for your browser’s download bar or icon. Some browsers ask once before a site may download files; allow it and click the button again.

Frequently asked questions

Why does the border triangle ignore my background colour?

The element has no content area at all, so a background has nothing to paint. The visible colour comes from one border. To fill a triangle with a gradient or an image, use the clip-path version, which keeps a real box.

How do I put a border around a CSS triangle?

Stack two triangles: a slightly larger one in the outline colour behind a smaller one in the fill colour, offset so a thin edge of the larger one shows. A real border on the element itself would be cut off by the triangle shape.

How does the border triangle work?

An element with no width or height shows only its borders, which meet at diagonals. Making all but one border transparent leaves a triangle.

Which method should I use?

clip-path is easier to read and takes gradients, but it also clips shadows. The border method works in every browser and can sit on a pseudo-element for a tooltip arrow.

Keep working with the result

After you download, choose “Save to Workstand” to keep the result in a folder on your computer, attach it to a project and create a follow-up task. It is saved by your browser, not uploaded.