美文网首页
css实现三角形

css实现三角形

作者: duans_ | 来源:发表于2018-09-20 10:51 被阅读6次

    css三角形实现代码

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
            .up{
                width: 0px;
                height: 10px;
                border-bottom: 10px solid red;
                border-left:10px solid transparent;
                border-right: 10px solid transparent;
                border-top:0;
            }
            .down{
                width: 0px;
                height: 10px;
                border-top: 10px solid red;
                border-left:10px solid transparent;
                border-right: 10px solid transparent;
                border-bottom:0;
            }
            .left{
                height: 0;
                width: 10px;
                border-left:10px solid red;
                border-bottom:10px solid transparent;
                border-top:10px solid transparent;
                border-right:0;
            }
            .right{
                height: 0;
                width: 10px;
                border-right:10px solid red;
                border-bottom:10px solid transparent;
                border-top:10px solid transparent;
                border-left:0;
            }
        </style>
    </head>
    <body>
        <div class="down"></div>
        <div class="left"></div>
        <div class="right"></div>
        <div class="up"></div>
    </body>
    </html>
    

    相关文章

      网友评论

          本文标题:css实现三角形

          本文链接:https://www.haomeiwen.com/subject/awpgnftx.html