Regex Cheatsheet
Every regex token, searchable, with an example of what it matches.
Generate the border trick that makes triangles and tooltip arrows.
The CSS Triangle Generator writes the border trick in any direction and size, alongside the modern clip-path equivalent and a complete tooltip arrow — which is what most people actually want a triangle for.
A CSS triangle is a zero-sized box with thick borders, where three of the four are transparent. Borders meet at a diagonal, so the one visible border becomes a triangle. It is a trick, it is everywhere, and it is fiddly to write from memory.
Pick a direction and a size and the declaration is generated, with the preview showing the real result. The modern alternative is generated alongside: clip-path with a polygon, which takes a real width and height rather than inverted border widths and can be animated. There is also a complete tooltip arrow snippet using a pseudo-element, since that is what most people actually want the triangle for.
The border trick for maximum compatibility and the clip-path polygon, which reads as what it is and can be animated.
The triangle need not be equilateral, which is what a wide flat arrow requires.
The four sides and the four diagonals, each with the correct border combination worked out.
A pseudo-element already positioned against its parent, with the offsets calculated.
Why a zero-sized box with thick borders produces four triangles, so the CSS stops looking arbitrary.
Up, down, left, right or one of the four diagonals.
Width and height are independent, so the triangle need not be equilateral.
The border trick and the clip-path equivalent are both generated.
A complete pseudo-element arrow, positioned and ready.
Borders meet at a 45-degree diagonal where they join. On a zero-sized box with thick borders, each border is a triangle — so making three of them transparent leaves one visible.
Often yes. clip-path takes real dimensions rather than inverted border widths, it can be animated, and it reads as what it is. Browser support has been universal for years.
Almost always a missing width and height of zero, or a border-style that is not solid. Both are required — a zero-width border-style of none produces nothing.
Use a ::after pseudo-element positioned absolutely against the tooltip, with the triangle pointing away from it. The snippet here does exactly that, with the offsets already worked out.
What people who use the CSS Triangle Generator think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the CSS Triangle Generator. It takes half a minute and no account.
Write the first reviewEvery regex token, searchable, with an example of what it matches.
Generate complete fake user profiles for seeding and design work.
Tidy a TOML file: consistent quoting, ordered tables, keys before headers.
Generate realistic test rows in JSON, CSV or SQL from fields you choose.
Generate Java POJOs or records with Jackson annotations from JSON.
Re-indent a SQL query into readable clauses, joins and conditions.
Build soft extruded UI with paired light and dark shadows.
Build and edit URL query strings without breaking the encoding.