小三角

作者: kelly_0416 | 来源:发表于2020-04-15 14:43 被阅读0次

    箭头朝向那个方向就不用写他的border,在反方向设置颜色 其他方向上的透明度为0

    /*箭头向上*/
    .arrow-up {
        width:0; 
        height:0; 
        border-left:30px solid transparent;
        border-right:30px solid transparent;
        border-bottom:30px solid #fff;
    }
        
     /*箭头向下*/
    .arrow-down {
        width:0; 
        height:0; 
        border-left:20px solid transparent;
        border-right:20px solid transparent;
        border-top:20px solid #0066cc;
    }
        
     /*箭头向左*/
    .arrow-left {
        width:0; 
        height:0; 
        border-top:30px solid transparent;
        border-bottom:30px solid transparent; 
        border-right:30px solid yellow; 
    }
       
    /*箭头向右*/
    .arrow-right {
        width:0; 
        height:0; 
        border-top:50px solid transparent;
        border-bottom: 50px solid transparent;
        border-left: 50px solid green;
    }
    

    相关文章

      网友评论

          本文标题:小三角

          本文链接:https://www.haomeiwen.com/subject/snecvhtx.html