Skip to content
Toolars
Explore

CSS Triangle Generator

Eight triangle directions, including diagonals; control dimensions and export matching markup and CSS.

Local processing

Processing details

Tool inputs are processed on your device.

Resources may be downloaded to run this tool. Account services are separate.

Privacy information
Report bug

Task path / input to outcome

How to create a CSS triangle

  1. 01

    Pick the direction

    Top right / Bottom right / Bottom left / Top left · 8

  2. 02

    Set the size

    Adjust Base width and Triangle height, each from 8 to 180 px in 1 px steps. For Up or Down, width is the base and height is the point's reach. For Left or Right, height is the vertical base and width is the horizontal reach. The default spans 72 px horizontally and 64 px vertically.

  3. 03

    Choose the fill color

    Set Fill color to any six-digit hex value — the default is #0f4cff. The live preview and the generated border-color declaration always stay in sync, so what you see is exactly what gets copied.

  4. 04

    Check the preview status

    The live preview re-renders on every change and the status badge reads VALID CSS when all values are in range. An out-of-range value flips it to CHECK VALUES and blocks copying and downloading until the highlighted control is fixed.

  5. 05

    Try the sample preset

    Press Load sample for a right-pointing triangle with 104 px horizontal reach, an 86 px vertical base, and #ffd11a fill. Reset restores the defaults at any time.

  6. 06

    Copy or download the CSS

    Press Copy CSS to copy the .triangle rule to the clipboard, or Download .css to save it as toolars-triangle.css. The rule sets width and height to zero and declares all four borders, ready to paste into any stylesheet. HTML includes the current CSS and a working example. Native controls support keyboard input.

Tool facts

Processing
In your browser
Input leaves this device
Never
Retention
Nothing is stored
Price
Free

Your input stays in the browser.

CSS Triangle Generator uses its verified local execution path and does not create a hidden input or output history.

Local execution

Runs inside the current browser tab.

No hidden processing

Active tool data never becomes a Toolars document record.

No account required

Use the core workflow without creating a profile. Favorites sync to your account after you sign in.

Immediate reset

Clear the tab and the active working data is gone.

What CSS Triangle Generator actually does

Dropdown carets, tooltip pointers, and breadcrumb separators all need a small crisp triangle, and an image file is the wrong tool for it: it blurs on high-density screens and adds a request to the page. A triangle built from CSS borders is resolution-independent and recolors with a single hex value. CSS Triangle Generator renders the shape locally as you tune direction, size, and fill, so iterating takes seconds. When it looks right, one click puts the finished .triangle rule on your clipboard.

Common questions

How does a pure-CSS triangle work?
The element gets zero width and height plus four borders. Coloring one border while the two adjacent borders stay transparent leaves a clean triangle — the generated .triangle rule shows exactly which border carries the Fill color for the direction you picked, and the border opposite the point collapses to zero. Eight triangle directions, including diagonals; control dimensions and export matching markup and CSS. HTML includes the current CSS and a working example. Native controls support keyboard input.
What sizes can I generate?
Base width and Triangle height both accept values from 8 to 180 px in 1 px steps. An out-of-range value flips the preview status to CHECK VALUES and blocks copying or downloading until the highlighted control is fixed, so the exported rule is always valid.
Is the triangle always symmetrical?
Eight triangle directions, including diagonals; control dimensions and export matching markup and CSS. Top right / Bottom right / Bottom left / Top left · 8
How do I recolor or resize the triangle later?
Edit the generated rule directly: only one border carries the fill color, the two adjacent borders are transparent, and the border opposite the point is zero. Changing the single hex value recolors it, and adjusting the border widths reshapes it — no generator needed after the first copy.
Will the output work in every browser?
Yes. Border-based triangles are one of the oldest techniques in CSS and need no image, SVG, or clip-path support, so the generated rule renders the same way in every modern browser, at any screen density, without a single network request.
Is anything uploaded or stored?
No. The preview is rendered locally from validated style values, and as the workspace footer states, no generated value enters storage, logs, analytics, or the network.

Related tasks, not a dead end.

Move into another focused workspace without returning to the full index.

CSS Loader Generator

264 loader templates: 24 geometries × 11 motion profiles; filter by category and inspect the animation.

Create

CSS Checkbox Generator

24 checkbox templates: eight marks × three transitions; click or press Space in the native preview.

Create

CSS Switch Generator

18 switch templates: six thumb shapes × three transitions; test the native control by click or keyboard.

Create

CSS Clip Path Generator

24 clip shapes, primitive parameters and editable polygon points; export CSS or a declaration.

Create