div制作三角形

<!DOCTYPE html>
<html>
    <head>
        <style>
            * {margin: 0;}
                
            .demo{background-color: aquamarine;
                padding: 1px;
                height: 300px;}
            .demo>div{width: 0px;
                height: 0px;
                margin: 100px;
                border-style: solid;
                border-width: 50px 0 50px 120px;
                border-color: transparent transparent transparent red;
                
                }
        </style>
        
    </head>
    <body>
        <div class="demo">
            <div></div>
        </div>
    </body>
</html>

 

posted @ 2022-05-19 22:06  我歌且谣  阅读(117)  评论(0)    收藏  举报