css3实现虚拟三角形

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        /*上箭头*/
        .triangle-up {
            width:0;
            height:0;
            border:10px solid transparent;
            border-bottom-color:yellow;
        }
        /*下箭头*/
        .triangle-down {
            width:0;
            height:0;
            /*transform: translate(-50%,-50%);*/
            border:10px solid transparent;
            border-top-color:yellow;
        }
        /*左箭头*/
        .triangle-left {
            width:0;
            height:0;
            border:10px solid transparent;
            border-right-color:yellow;
        }
        /*右箭头*/
        .triangle-right {
            width:0;
            height:0;
            /*transform: translate(-50%,0);*/
            border:10px solid transparent;
            border-left-color:yellow;
        }
    </style>
</head>
<body>
    <div class="triangle-right"></div>
</body>
</html>

 

posted @ 2016-10-08 14:50  不正经的CodeMonkey  阅读(371)  评论(0编辑  收藏  举报