CSS三角

    1/* 设置1个盒子 */
    2div {
    3  /* 将盒子宽高设为0 */
    4	width: 0;
    5  height: 0;
    6  /* 为盒子设置边框,并将颜色设置为transparent */
    7  border: 30px solid transparent;
    8  /* 单独为想要的三角形设置颜色 */
    9  border-bottom-color: pink;
    10  /* 照顾低版本浏览器的兼容性 */
    11  font-size: 0;  
    12  line-height: 0;
    13}
    • 画任意三角形
      • 每个边的宽度对应内部三角形的高