x

Having A Problem Calling An Image From HTML!

Can anybody please help me with this issue. I have uploaded two images to my 'Assets' folder inside the "Edit HTML/CSS" section and after saving, i created an HTML snippet to call the two images. But when I published my site, the images did not display. However, what's weird is that when I came to preview my site inside the "Edit HTML/CSS", the images seemed to appear normally. How can I fix this issue? That's my code below.

<img src="new-arrivals.png"  style="margin: 10px 0px 0px 0px;width:429px;height:185px;">
<a href="http://www.inpha.co/new-arrivals.html"target="_blank"</a><img src="new-arrivals-button.png" style="margin: 60px 0px 0px -228px;width:198px;height:40px;">
8,174 Views
Message 1 of 28
Report
1 Best Answer

Best Answer

@Adam I figured out the problem.  Your suggestion of how, in the CSS code, to reference the filepath for the images was "sort of" right, with a slight modification.

This is what ultimately worked:

background:transparent url(images/yourimage.jpg) no-repeat center center;

I found this link to be helpful. https://css-tricks.com/quick-reminder-about-file-paths/

This problem has it's own topic.  Here's a link: https://community.weebly.com/t5/Site-Editor/Help-with-CSS-Can-t-get-images-to-show-up-as-expected/m-...

View Best Answer >

5,930 Views
Message 29 of 28
Report
27 REPLIES 27
Square

Honestly, it's hit or miss with coding questions. Sometimes people will come on and start helping out, but then take some time off for a bit. If someone is available, they will chime in. Smiley Happy 

@MTpockets

2,253 Views
Message 29 of 28
Report

@Adam how do I engage the community for some help? Would it be best to start a new topic for this?
2,251 Views
Message 29 of 28
Report

I wonder if this does actually have to do with it being a preview site. I'm curious - if you export the theme, then use it with a different free site (assuming you also have a standard account with sites in it), does it work?

2,249 Views
Message 29 of 28
Report

@BJ Thanks for chiming in.  I don't think it's a preview issue. I am hoping someone can view the source code while in their browser to help diagnose this.

2,247 Views
Message 29 of 28
Report

Here's a link to a test site preview with the same code... and the same results: no image.
http://helpingsites.loginportal.site/preview/26036d.mfl93g7fe7m4f.9f15d286555c143c9d13bc8c7a459852

Looking to find out why the image is not showing up. Again, the image filename in the code is yourimage.jpg and has been uploaded into assets/image.
2,246 Views
Message 29 of 28
Report

Best Answer

@Adam I figured out the problem.  Your suggestion of how, in the CSS code, to reference the filepath for the images was "sort of" right, with a slight modification.

This is what ultimately worked:

background:transparent url(images/yourimage.jpg) no-repeat center center;

I found this link to be helpful. https://css-tricks.com/quick-reminder-about-file-paths/

This problem has it's own topic.  Here's a link: https://community.weebly.com/t5/Site-Editor/Help-with-CSS-Can-t-get-images-to-show-up-as-expected/m-...

5,931 Views
Message 29 of 28
Report
Square

That's great, @BKP! I'm going to mark your posts as solutions for anyone else that sees this.

2,218 Views
Message 29 of 28
Report
This thread has been archived and locked. Please start a new thread if you would like to continue the conversation.