css实现三角形

2018-09-20  本文已影响6人  duans_

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>
上一篇下一篇

猜你喜欢

热点阅读