码迷,mamicode.com
首页 > Web开发 > 详细

用border做纯CSS的三角形

时间:2015-12-14 18:16:59      阅读:146      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        body{margin:0;padding: 0;}
        div{margin:10px;}
        .b0{height:100px;
            width:100px;
              border-top:solid 50px red;
              border-left:solid 50px yellow;
              border-right:solid 50px green;
              border-bottom:solid 50px blue;
          }
          .b1{height:0px;
              width:0px;
             border-top:solid 50px red;
              border-left:solid 50px yellow;
              border-right:solid 50px green;
              border-bottom:solid 50px blue;
        }
        .b2{height:0px;
              width:0px;
             border-top:solid 50px red;
              border-right:solid 50px green;
        }
        .b3{height:0px;
              width:0px;
             border-top:solid 50px red;
              border-right:solid 50px rgba(0,0,0,0);
        }
        .b4{height:0px;
              width:0px;
             border-top:solid 30px red;
              border-right:solid 40px rgba(0,0,0,0);
        }
        .b5{height:0px;
              width:0px;
             border-top:solid 50px red;
              border-left:solid 50px rgba(0,0,0,0);
              border-right:solid 50px rgba(0,0,0,0);
          }
    </style>
</head>
<body>
    <div class="b0"></div>
    <div class="b1"></div>
    <div class="b2"></div>
    <div class="b3"></div>
    <div class="b4"></div>
    <div class="b5"></div>
</body>
</html>

技术分享

用border做纯CSS的三角形

标签:

原文地址:http://www.cnblogs.com/crystalmoore/p/5045722.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!