CSS Shapes – Triangle

It’s the second part of CSS Shapes. In this tutorial we are discussing about drawing another CSS Shapes – Triangle. Triangles also can be used as arrow as per your requirements. You can find the formula to create an equal sided triangle at the end of article.

You can visit other parts of tutorial here:

CSS Shapes - Triangle
  1. CSS Shapes – Circle
  2. CSS Shapes – Triangle
  3. CSS Shapes – Square Rectangle Parallelogram Trapezoid and Polygons
  4. CSS Shapes – Diamond and Star
  5. CSS Shapes – Chart and Ribbon
  6. Different CSS Shapes

 

Triangles: Up, Down, Left, Right


Traingles: Top Right, Top Left, Bottom Right, Bottom Left


To draw an equilateral triangle shape with CSS just note that the height is 86.6% of the width so just set

border-bottom-width = (border-left-width + border-right-width) * 0.866

You Might Interested In

Leave a Reply

Enclose a code block like: <pre><code>Your Code Snippet</code></pre>.