宽和高指定为0
指定边框border-top-color:颜色; 改变边框粗细来改变三角形大小
其余指定为transparent
选择器 {
/*不要忘了子绝父相*/
position: absolute;
right:;
top:;
width:0;
height:0;
/*为了照顾兼容性*/
line-height:0;
font-size:0;
border: 5px solid transparent;
border-bottom-color: pink;
}
cs