美文网首页
CSS画三角

CSS画三角

作者: 大女表哥 | 来源:发表于2016-08-15 15:12 被阅读0次

    这个还是比较常用的

    <div class="arrow-up"></div>
    <div class="arrow-down"></div>
    <div class="arrow-left"></div>
    <div class="arrow-right"></div>
    

    css如下:

    .arrow-up {
     width: 0; 
     height: 0; 
     border-left: 5px solid transparent;
     border-right: 5px solid transparent;
     border-bottom: 5px solid black;
    }
    
    .arrow-down {
     width: 0; 
     height: 0; 
     border-left: 20px solid transparent;
     border-right: 20px solid transparent;
     border-top: 20px solid #f00;
    }
    
    .arrow-right {
     width: 0; 
     height: 0; 
     border-top: 60px solid transparent;
     border-bottom: 60px solid transparent;
     border-left: 60px solid green;
    }
    
    .arrow-left {
     width: 0; 
     height: 0; 
     border-top: 10px solid transparent;
     border-bottom: 10px solid transparent; 
     border-right:10px solid blue; 
    }
    

    可以在这 http://jsbin.com/wetosuqobo/edit?html,css,output 看下效果或者自己搞下

    相关文章

      网友评论

          本文标题:CSS画三角

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