Basically, I have a div
with background set to an image and opacity
of 0.5
. Inside the div
, I am trying to place the same img
as a circle. However, it gets the 0.5 opacity
too.
What is a good way to make sure this doesn't happen?
<div class="bg-img" ng-style="{'background':'url({{vm.large}}) center / cover'}">
<img ng-src="{{vm.large}}">
</div>
.bg-img {
height: 140px;
position: relative;
opacity: 0.6;
}
.bg-img img {
width: 100px;
height: 100px;
border-radius: 50%;
position: absolute;
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…