设置伪元素在父元素下方

效果:在这里插入图片描述
父元素加上 transform-style: preserve-3d;
伪元素加上 transform: translateZ(-10px);

.other-style a.select {
    position: relative;
    font-size: 18px;
    color: #333;
    transform-style: preserve-3d;
}
.other-style a.select::before {
    content: '';
    position: absolute;
    bottom: 3px;
    z-index: 0;
    left: 17px;
    width: 47px;
    height: 11px;
    background: #2FC4A0;
    border-radius: 30px;
    transform: translateZ(-10px);
}

你可能感兴趣的:(css,css,html,前端)