# How to Make a Triangle in CSS (3 Ways)

DevFeed: [How to Make a Triangle in CSS (3 Ways)](<https://devfeed.tech/articles/how-to-make-a-triangle-in-css-3-ways-122992.md>)

Original publisher: [Read original article](<https://markodenic.com/css-triangle/>)

Author: Marko

Published: 2026-11-09T09:00:00Z

Content type: tutorial

Language: en

Sources: [Marko Denic Blog](<https://devfeed.tech/sources/marko-denic-blog.md>)

Topics: [CSS](<https://devfeed.tech/topics/css.md>), [Front end](<https://devfeed.tech/topics/frontend.md>), [Web Development](<https://devfeed.tech/topics/web-development.md>)

Tags: [arrow](<https://devfeed.tech/tags/arrow.md>), [border](<https://devfeed.tech/tags/border.md>), [clip-path](<https://devfeed.tech/tags/clip-path.md>), [css](<https://devfeed.tech/tags/css.md>), [gradient](<https://devfeed.tech/tags/gradient.md>), [speech](<https://devfeed.tech/tags/speech.md>), [svg](<https://devfeed.tech/tags/svg.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>), [web-development](<https://devfeed.tech/tags/web-development.md>)

## AI overview

Use `clip-path` as the general-purpose CSS triangle method: define a box and cut it with a three-point `polygon()`. Changing the points makes triangles point in different directions; `aspect-ratio: 1 / 0.866` gives an equilateral triangle. For small, solid-color tooltip or dropdown arrows, the border trick makes a triangle from a zero-sized box with one colored border and adjacent transparent borders; the triangle points away from the colored side. A rotated square can provide an arrow with a real border or shadow, while a hard-stop linear gradient creates a right-triangle background decoration. `clip-path` and the border trick do not retain a triangle border; for that, the excerpt suggests stacking triangles, using a rotated square, or using SVG. For a shadow that follows the visible shape, use `filter: drop-shadow()` rather than `box-shadow`. The excerpt recommends SVG for icons and complex shapes.

## Source excerpt

Make triangles in pure CSS with clip-path, the classic border trick, or gradients. Triangles pointing in every direction, equilateral triangles, and tooltip and dropdown arrows.