css中书写小三角

我们在开发过程中,有很多的方向标签不是图片,而是用css方法书写上去的。

首先我们要了解原理,border的边框的脚步是45度角。

向左方向:

width:0px;

height:0px;

border-top:4px solid transparent;

border-right:4px solid black;

border-bottom:4px solid transparent;

border-left:4px solid transparent;

向右方向:

width:0px;

height:0px;

border-top:4px solid transparent;

border-left:4px solid black;

border-right:4px solid transparent;

border-bottom:4px solid transparent;

剩下的同学们自己发挥吧。