Replacing an Image

David Schure
David Schure used Ask the Experts™
on
I need to replace an URL image with a local image.
<div class="section_bg_image" style="background-image: url(https://via.placeholder.com/1920x900)"></div>

Open in new window


/resources/newimage.png
How can this be done. Thank you.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Fractional CTO
Distinguished Expert 2018
Commented:
Can't be done.

Or rather, you can do anything you like + only you will see this image, as there's no way to directly serve a local image to public visitors.

To change this locally, replacing url(...) with url(file:///path-to-your-image.jpg) will work.

And again, only you will see local images. External visitors will see the browser specific broken image icon.

Author

Commented:
Thank you.
David FavorFractional CTO
Distinguished Expert 2018

Commented:
You're welcome!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial