So im trying to change the image depending on if the user is on mobile or desktop version.
I have two different images, the one with an "m" in the end is a mini-version which is for desktop, and the other is for mobile. I cant get it to work though.
Here's some code:
HTML (Using Razor, so C# code works):
<img id="ifMobile1" src="images/arts/IMG_1447m.png" alt="">
CSS:
#ifMobile1 {
background-image: url(/images/arts/IMG_1447m.png)
}
@media all and (max-width: 499px) {
#ifMobile1 {
background-image: url(/images/arts/IMG_1447.png)
}
}
Help me please.