1
试图在图像上放一个阴影,我需要把:before或:after放在父元素后面才能使其工作。任何建议都会很棒。:之前伪元素绝对定位父
.g-w-a {
background-repeat: no-repeat;
display: block;
height: 240px;
position: absolute;
width: 160px;
background-color: rgba(255, 0, 0, 0.5);
}
.g-w-a::after {
background-color: rgba(0, 0, 0, 1);
content: "";
height: 20px;
left: 40px;
position: absolute;
top: 210px;
width: 50px;
z-index: -2;
}
<div style="background-image: url(http://static.soliaonline.com/a/ae4329867a01e99b6b8ddbeb3d1c6f03.png)" class="g-w-a"><div class="t-shad">Rasen</div></div>
https://jsfiddle.net/bunzons9/1/
你想放阴影图像还是落后的形象呢? – kanudo
您不能将元素放置在元素本身下方的另一个元素内。 –