纯css写三角形

<style>
    .triangle_border_up {
        width: 0;
        height: 0;
        border-width: 0 30px 30px 30px;
        border-style: solid;
        border-color: transparent transparent #333;
        /*透明 透明  灰*/
    }
    .triangle_border_left {
        width: 0;
        height: 0;
        border-width: 30px 30px 30px 0;
        border-style: solid;
        border-color: transparent #333 transparent transparent;
        /*透明 灰 透明 透明 */
        
        margin: 40px auto;
        position: relative;
    }
</style>

<div class="triangle_border_up"></div>
<div class="triangle_border_left"></div>

你可能感兴趣的:(css)