Generator trójkątów CSS

Create pure CSS triangles using the border trick. Choose direction, size, and color.

Ad Space
100px
100px

CSS Code

Ad Space

How CSS Triangles Work

CSS triangles are created by setting the element's width and height to 0 and using thick borders. By making three of the four borders transparent and coloring one, you get a triangle shape pointing in the desired direction. This classic CSS trick is supported in every browser.

When should I use CSS triangles?

CSS triangles are useful for tooltips, dropdown arrows, breadcrumbs, and decorative elements. They're lightweight and don't require images or SVGs.

How It Works

  1. Choose direction: Select which direction the triangle points — up, down, left, right, or diagonal.
  2. Set dimensions and color: Enter the width, height, and fill color using a color picker or hex value.
  3. Preview live: The triangle renders in real time as you adjust settings.
  4. Copy the CSS: Copy the generated CSS using the border-trick technique to paste into your stylesheet.

Why Use CSS Triangle Generator?

CSS triangles are created using the border trick: an element with zero width and height has visible borders on adjacent sides. When three of the four borders are made transparent, the visible border forms a triangle shape. This technique is used for dropdown menu carets, speech bubble tails, decorative arrows, accordion toggle indicators, tooltip pointers, and divider shapes. Pure CSS triangles are faster than SVG or image files, require no additional HTTP requests, and scale with the text. However, the border math is confusing — this generator handles all the calculations automatically.

Available Triangle Types

Related Tools