|
Post by Frank on Jan 31, 2022 22:40:43 GMT
I have this in events: this.style.backgroundImage='url(logo.jpg)'; What exactly do I have to enter for 'url(logo.jpg)' for my logo.jpg in the root to show in a preview? I'm drawing a huge mental blank! (I don't have an url yet) Frank
|
|
|
Post by J on Feb 2, 2022 10:19:55 GMT
Hi Frank,
If you import a file named logo.jpg into the same folder as the web page, the code you've got should work as is.
If your image is in a subfolder, it'd be: 'url(subfolder/logo.jpg)';
If your image is in a parent folder of the page, something like 'url(../logo.jpg)'; would work. The .. indicates up one level. So ../../logo.jpg would be two folder levels up.
Cheers, J
P.S. You can also try prefixing with a forward slash: 'url(/logo.jpg)'; if the image really is in the root after publishing - but I'm not sure how that plays during preview.
|
|