How to Make a Triangle in CSS Without an Image
Every tooltip tail and dropdown caret on the web is one of two things: an SVG, or an empty element with three transparent borders. The second is older, lighter, and inherits colour from your stylesheet. It is also the source of the single most common CSS confusion going, which is that a triangle pointing up is built from a bottom border.
Pick a direction, a base width, a height and a colour. The rule sets width and height to zero and colours the border opposite the direction you chose.

Workflow Lifecycle & Pipeline
Visual execution flow showing how CSS Triangle Generator processes data directly in your local browser sandbox.
CSS Triangle Generator Interactive Process Pipeline
Fast, zero-latency execution directly in your browser memory.
Before You Start
Ensure your source assets and browser environment meet the verified execution requirements.
Step-by-Step Instructions
Follow these verified steps to execute the task with CSS Triangle Generator.
Enter points towards
Fill in points towards, base width (px) and height (px), plus the 1 below. Each starts at a usable value, so you can change one and leave the rest.
Points Towards Up · Base Width (px) 40 · Height (px) 304 fields read as you typeWatch the result change
There is no button on CSS Triangle Generator: the result follows the input as you change it.
Updates as you typeCSS Triangle Generator runs on your deviceCopy the answer
The answer sits at the top of the result panel with a copy button beside it. It never left your browser.
Copy the figureOn your clipboardUnder the Hood: Sandboxed WASM Execution & Isolated Web Workers
Development tools and code sandboxes execute inside sandboxed Web Workers with isolated thread runtimes. Code scripts cannot access DOM scopes, cookies, or local network interfaces, providing high security and bare-metal performance.
Real-Time Stdin Stream
Interactive inputs pipe directly into std::cin, sys.stdin, and ReadLine buffers via simulated virtual teletypes.
Zero Egress Guarantee
Algorithm logic, API keys, and test queries remain confined to the client virtual machine.
Near-Native CPU Performance
Precompiled WebAssembly modules execute with near-native JIT performance on V8 and SpiderMonkey engines.
Settings & Options Explained
Fine-tune quality, format, and compression parameters for your exact workflow.
Settings & Configuration Guide
| Setting | Recommended Value | How It Works & Impact |
|---|---|---|
| Points Towards | Up | Takes one of Up, Down, Left or Right. Impact: Each option is a different points towards; switching it changes the result, not the speed. |
| Base Width (px) | 40 | Takes a number from 1 to 400. Impact: The control runs from 1 to 400; 400 is as far as it goes. |
| Height (px) | 30 | Takes a number from 1 to 400. Impact: The control runs from 1 to 400; 400 is as far as it goes. |
| Fill Colour | #4f46e5 | Takes a colour. Impact: Read as written, so stray spaces and characters count. |
Best Practices & Key Considerations
Avoid common quality pitfalls and maximize output performance.
Expert Recommendations
- If your arrow points the wrong way, you have coloured the border matching the direction instead of the one opposite it. Up is border-bottom.
- The two transparent borders take half the base each, because together they are the base. Set both to the full width and the triangle comes out twice as wide as you asked.
- Position the tail with absolute positioning on a parent that has position: relative, then nudge it with a negative offset equal to its height.
Common Mistakes to Avoid
- Expecting Base Width (px) to go past 400 — 1 to 400 is the range the control offers.
- Expecting Height (px) to go past 400 — 1 to 400 is the range the control offers.
- Leaving Points Towards on Up when Down or Left was wanted.
- Assuming the input is sent somewhere — CSS Triangle Generator runs in this tab, and nothing you enter leaves it.
Troubleshooting & Fixes
Quick solutions for common browser constraints, format issues, and edge cases.
Troubleshooting & Common Issues
Base Width (px) will not go above 400
Possible Cause: The control runs from 1 to 400.
Height (px) will not go above 400
Possible Cause: The control runs from 1 to 400.
The answer is right but not in the form you wanted
Possible Cause: Points Towards is set to Up, and it decides that.
Frequently Asked Questions
Everything you need to know about formats, privacy, and browser support.
Related Step-by-Step Guides
Explore companion workflows, optimization techniques, and verified tutorials.