Created
September 16, 2020 18:23
-
-
Save scottopolis/b29ebf47791a46d439946970e3d4c644 to your computer and use it in GitHub Desktop.
Replace image source with CSS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Works even if the image has no class or id */ | |
img[src="https://mysite.com/my-image.jpg"] { | |
content:url("https://mysite.com/my-image-2.jpg"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment