纯css实现不同方向的三角形

 

 

.triangle {
    position: relative;
    &:after {
        position: absolute;
        top: 50%;
        transform: translate(0,-50%);
        right: 0;
        content: '';
        display: block;
        width: 0;
        height: 0;
        background: transparent;
        border: 10px solid transparent;
        border-top-color: transparent;
        border-bottom-color: transparent;
        border-left-color: transparent;
        border-right-color: #0f0;
    }
}

 

转载于:https://www.cnblogs.com/stella1024/p/10550885.html

你可能感兴趣的:(纯css实现不同方向的三角形)