Briefly
In front, we have shared about the implementation of the triangle, mainly according to the border property to set, the following we have to achieve the top, bottom, left, right a variety of different colors of the triangle.
Achieve results
Source
<! DOCTYPE html><html><head><style type=' text/css '>/ * Upper triangle * /. arrow-up { width: 0; height: 0; border-left: px solid transparent; border-right: px solid transparent; border-bottom: px solid green; }/ * Lower triangle * /. Arrow-down { width: 0; height: 0; border-left: px solid transparent; border-right: px solid transparent; border-top: px solid orange; }/ * Right triangle * /. Arrow-right { width: 0; height: 0; border-top: The px solid transparent; border-bottom: The px solid transparent; border-left: solid blue, px; }/ * Left triangle * /. Arrow-left { width: 0; height: 0; border-top: tenpx solid transparent; border-bottom: tenpx solid transparent; border-right: tenpx solid silver; }</style></head><body> <div class="arrow-up"></div> <div class="Arrow-down"></div> <div class="Arrow-left"></div> <div class="Arrow-right"></div></body></html>
The code is relatively simple, I will not too much elaboration!
CSS3 Create transparent Border triangle