CSS Code section
*{margin:0; padding:0;} /* Simple Initialization */
#box {margin:0 auto; width:400px; background: #ccc; border:1px solid #000; padding-left:150px;}
#box1, #box2, #box3 {width:0; height:0; border-style:solid; Border-color: #ccc #ccc Green #ccc; }
#box1 {border-width:60px;border-top-width:0;margin-left:40px;}
#box2 {border-width:80px;border-top-width:0;margin-left:20px;}
#box3 {border-width:100px;border-top-width:0;}
#box4 {width:30px; height:200px; background:green; margin-left:85px;}
HTML code section:
<div id= "box" >
<div id= "Box1" ></div>
<div id= "Box2" ></div>
<div id= "Box3" ></div>
<div id= "Box4" ></div>
</div>
Implementation of the principle of analysis: the width of the box is set to 0, set the color of one side, so that the other three edges are consistent with the background color. Set the background color of the corresponding border for the arrow in which direction you want it to go.
CSS Triangle (pine)