css做三角形

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        div{
            width:0;
            height:0;
            border:5px solid;
    /*注:border-color中,设置了颜色那个边框就是三角形的底边框*/
            border-color: transparent red  transparent  transparent;
        }
    </style>
</head>
<body>
<div></div>
</body>
</html>    

 

posted @ 2016-11-15 10:24  dongxiaolei  阅读(136)  评论(0编辑  收藏  举报