CSS como usar o Triangle
January 04, 2020
Creates a triangle shape with pure CSS.
<div class="triangle"></div>.triangle {
width: 0;
height: 0;
border-top: 20px solid #333;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
}Explanation
- View this link for a detailed explanation.
- The color of the border is the color of the triangle. The side the triangle tip points corresponds to the opposite
border-*property. For example, a color onborder-topmeans the arrow points downward. - Experiment with the
pxvalues to change the proportion of the triangle.