<!DOCTYPE html>
<html>
<head>
    <style type="text/css">
        #trangle {
            display: inline-block;
            width: 200px;
            height: 200px;
            border-left: 100px solid #333;
            border-right: 100px solid #678;
            border-top: 100px solid #91b;
            border-bottom: 100px solid #eee;
        }
    </style>
</head>
<body>
    <span id="trangle"></span>
</body>
</html>

 

用CSS画个三角形

 

<!DOCTYPE html>
<html>
<head>
    <style type="text/css">
        #trangle {
            display: inline-block;
            border-left: 100px solid #333;
            border-right: 100px solid #678;
            border-top: 100px solid #91b;
        }
    </style>
</head>
<body>
    <span id="trangle"></span>
</body>
</html>

用CSS画个三角形

<!DOCTYPE html>
<html>
<head>
    <style type="text/css">
        #trangle {
            display: inline-block;
            border-left: 100px solid transparent;
            border-right: 100px solid transparent;
            border-top: 100px solid #91b;
        }
    </style>
</head>
<body>
    <span id="trangle"></span>
</body>
</html>

用CSS画个三角形

把两边设置transparent透明就可以l,利用border的特性

 

相关文章:

  • 2021-11-09
  • 2022-12-23
  • 2021-12-29
  • 2021-06-24
  • 2022-12-23
  • 2021-08-31
  • 2022-12-23
猜你喜欢
  • 2021-08-30
  • 2022-12-23
  • 2021-08-22
  • 2021-07-11
相关资源
相似解决方案