@Ikuewumi
Posted
Hi @ParthUON. Awesome Project š
About your question, I was impressed by the use of the content
property, I always thought it was only used in pseudo-elements. But the answer here would be to use the picture element,
This is an example
<picture>
<source srcset="...desktop.jpg" media="(min-width: 40rem)">
<img src="...mobile.jpg" alt="">
</picture>
picture {
display: contents;
}
picture img {
width: xrem;
// more
}
What happens is that the browser switches out the src of the image when it hits a specified media query
A caveat though is that the content that is shown is only the image tag, so I would suggest, putting any styles on the image tag
You can learn more about the picture tag on the MDN docs
And btw what do you need parallax for?
Happy Coding, Ayobami
Marked as helpful
@ParthUON
Posted
@Ikuewumi thank you for your advice. i will keep in mind next time. i want to create my portfolio website using parallax effect.