I want to make one image as a background for another (it will be the same image). This is going to work only on mobile version of site. I was trying different combinations of positions and displays, but it doesn't work and this is as far as I could get:
This is how my Vue code looks like:
<div class="img-big">
<img
v-if="productCard.file"
:src="`${productCard.file}`"
:alt="productCard.altText || productCard.text"
class="blur-background-img"
>
<img
v-if="productCard.file"
:src="
`${productCard.file}`
"
:alt="productCard.altText || productCard.text"
/>
</div>
And this is scss code:
.img-big {
img {
display: block;
margin: 0px auto;
@media only screen and (max-width: 420px) {
z-index: 2;
width: 70%;
top: 0;
}
}
.blur-background-img {
z-index: 1;
filter: blur(8px);
margin: 0;
width: 100%;
}
}
The only thing that I know works correctly is z-index
, but I need to put one image (not blurred) on another (blurred, as a background)