December 12, 2022 at 9:32 pm
#10042491
Keymaster
Hello, the way you did is correct, it should be working, if possible send me the URL of your site so I can check.
Another way to do that with background images is this:
EXAMPLE:
.hero {
/* Fallback */
background-image: url("platypus.png");
/* Chrome/Edge/Opera/Samsung, Safari will fallback to this as well */
background-image: -webkit-image-set(url("platypus.png") 1x, url("platypus-2x.png") 2x);
/* Standard use */
background-image: image-set(url("platypus.png") 1x, url("platypus-2x.png") 2x);
}
More details: https://drafts.csswg.org/css-images-4/#image-set-notation
Hope that helps.