首页 > 技术文章 > web中利用边框制作三角形

bigswallow 2017-07-11 19:24 原文

<!DOCTYPE html>
<html>
  <head>
  <meta charset="UTF-8">
    <title>边框制作三角形</title>
    <style>
      div{
        width:0px;
        height:0px;//让块的高和宽为零,是下面边框汇成一点
        
        border-bottom: 100px solid orange;
        border-left: 100px solid transparent;  //把左边的三角形颜色隐藏
        border-right:100px solid transparent;
        border-top:100px solid transparent;


      }
    </style>

  </head>
  <body>
    <div></div>//建立布局
  </body>

 

//实现效果如下


</html>

 

推荐阅读