Pinatool
Clip-Path & Transparent Border CSS

CSS Triangle Generator

Build pure CSS triangles and pointer arrows in 8 directions. Switch between modern clip-path polygons and classic CSS borders, adjust dimensions, and copy ready-to-use code.

Triangle Preview

Compare clip-path polygon and zero-box CSS border triangles.

Presets

CSS Technique

Uses polygon() on a sized element so backgrounds and gradients work cleanly.

Direction
Runs 100% locally in your browser.

Generated HTML & CSS

Copy the semantic HTML placeholder or CSS triangle rule.

<div class="triangle" aria-hidden="true"></div>

.triangle {
  width: 160px;
  height: 120px;
  background: #14b8a6;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

How to Create a Pure CSS Triangle

1

Choose Technique & Direction

Pick Clip-Path or CSS Borders, then select any of the 8 cardinal or corner directions—or start from a quick preset.

2

Set Width, Height & Color

Enter exact pixel dimensions for isosceles, equilateral, or right-angled triangles and preview against light or dark backgrounds.

3

Copy HTML & CSS

Copy the generated CSS declarations and accessible HTML markup directly into tooltips, dropdowns, or badges.

CSS Triangle Generator Features

8 Cardinal & Corner Directions

Generate top, right, bottom, left pointers as well as diagonal corner triangles for ribbons and callouts.

Dual CSS Output Modes

Toggle between `clip-path: polygon(...)` and classic transparent CSS borders with a single click.

100% Browser-Local

Instant previewing and code generation in your browser with zero server requests.

Frequently Asked Questions

Should I choose Clip-Path or CSS Borders for triangles?

Choose `clip-path` when you want to apply gradients, background images, or responsive sizing cleanly. Choose `CSS Borders` when you need maximum legacy browser compatibility with a zero-dimension element.

How does the CSS border triangle technique work?

When an element has `width: 0` and `height: 0`, its four borders meet at diagonal angles. Making adjacent borders `transparent` and giving one border a solid color creates a crisp triangle.

Can I generate diagonal or corner triangles?

Yes. In addition to the four cardinal directions (up, right, down, left), you can select any of the four corner directions (`top-left`, `top-right`, `bottom-right`, `bottom-left`) for ribbons and folded corners.

Why does the HTML snippet include aria-hidden="true"?

Decorative CSS triangles used for tooltips, carets, and ribbons do not convey semantic text to screen readers, so `aria-hidden="true"` keeps assistive technology output clean.

Does this tool upload anything to a server?

No. All previews and CSS/HTML exports are generated locally in your browser.