We use essential cookies to make this site work. Optional analytics cookies help us improve your experience. Privacy Policy
CSS Triangle Generator
Free CSS triangle generator. Create arrows, tooltips, and speech-bubble pointers with pure CSS borders in any direction, size, or color. No SVG needed.
How to use
Pick a Direction — Choose one of 8 directions — four cardinal arrows or four corner triangles.
Set Size — Adjust the triangle's base in pixels. Larger values produce bigger triangles.
Pick a Color — Choose any CSS color. The preview updates live.
Copy CSS — Copy the generated CSS class and paste it into your stylesheet.
Free CSS Triangle Generator
Generate pure-CSS triangles for tooltips, speech bubbles, dropdown carets, ribbons, and badges. No SVG, no images, no extra HTTP requests. Pick a direction, size, and color — copy production-ready CSS.
How CSS Triangles Work
A box with zero width and height does not render its content but still renders its borders. When two adjacent borders are set thick, they meet at a 45-degree diagonal. Setting two borders transparent and one solid produces a triangle pointing in the direction of the solid border.
Use With Pseudo-Elements
Triangles look best as ::before or ::after pseudo-elements attached to tooltips, dropdowns, or chat bubbles. Position the pseudo-element absolutely and the parent becomes a self-contained speech bubble.
Privacy
All preview and code generation happen locally in your browser.
By giving an element width and height of 0 and using thick transparent and solid borders. Where two borders meet they form a 45-degree slope — the visible solid border becomes a triangle.
Why not just use SVG?
CSS triangles add zero HTTP requests, work on any element via pseudo-elements (::before, ::after), and inherit the element's color via currentColor. Perfect for tooltips, dropdowns, and ribbons.
Can I make the triangle responsive?
Yes. Use em or rem instead of pixels in the border values so the triangle scales with the parent font-size.
Will this work in old browsers?
Yes. CSS border triangles work in every browser, including Internet Explorer 6 and up.
Related free tools
Text Shadow Generator — Design CSS text shadows with a visual editor and live preview.