I'm utilizing relative
and absolute
positioning but for some reason, it's not functioning correctly. Can anyone pinpoint where I've gone wrong?
https://i.sstatic.net/nmd6E.png
https://i.sstatic.net/p5GrX.png
This is my HTML code:
.slide-item {
text-align: center;
height: 400px;
position: relative;
}
.slide-item img {
display: block;
}
.slide-item .sale {
position: absolute;
top: -20px;
right: 20px;
display: block;
}
<div class="slide-item">
<div class="sale">
<img src="https://via.placeholder.com/50" alt="">
</div>
<img src="https://via.placeholder.com/150" class="arr-img" alt="">
</div>