html 打三角形

先写一个div

将边框设置大一点

最后将div高度宽度设置为0

transparent透明

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <style type="text/css">
        div {
            height:0px;
            width:0px;
            border-top:90px solid red;
            border-left:90px solid green;
            border-right:90px solid pink;
            border-bottom:90px solid blue;
        
        
        }


    </style>
</head>
<body>
    <div></div>
</body>
</html>
原文地址:https://www.cnblogs.com/v587yy/p/6673408.html