css绘制三角形

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style>
            #triangle-up {
                width: 0;
                height: 0;
                border-left: 50px solid red;
                border-right: 50px solid yellow;
                border-bottom: 50px solid greenyellow;
                border-top: 50px solid #0F9AE0;     /*加 transparent 属性可以使相应的边框隐藏*/
            }
        </style>
    </head>
    <body>
        <div id="triangle-up"></div>
    </body>
</html>


效果图如下:

posted @ 2016-04-27 10:16  好叶叶孤城  阅读(184)  评论(0编辑  收藏  举报