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,117 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,873 Views
Message 29 of 28
Report
27 REPLIES 27

nevermind i have fixed the problem. lol 

6,889 Views
Message 29 of 28
Report

Good news, Ŧrīnīty!

So what was the solution?

6,878 Views
Message 29 of 28
Report

I like to know that too.

6,876 Views
Message 29 of 28
Report

Well, I first thought that I have to call the file like this: /assets/filename.jpg, but unfortunately that also did not work. And I didn't want to call the images from a third party server as my images were customized. So I have uploaded my two custom images into a password protected page on my website called "Uploads" which I use for uploading content which only I could see. This should be the alternative from calling it from CSS. After that, I created the HTML code and referenced my uploaded images on Weebly's servers. The final code looks like this: 

<img src="http://www.inpha.co/uploads/6/3/8/8/63884033/new-arrivals.png"  
style="margin: 10px 0px 0px 0px;width:429px;height:185px;">
<a href="http://www.inpha.co/new-arrivals.html"</a>
<img src="http://www.inpha.co/uploads/6/3/8/8/63884033/new-arrivals-button.png"
style="margin: 60px 0px 0px -225px;width:198px;height:40px;">
6,855 Views
Message 29 of 28
Report
Square

Any images or files you upload in the Theme Editor will have the following URL structure:

http://www.inpha.co/files/theme/filename.extension

Your method of using a hidden page is a good alternative though, and can be done without customizing a theme.

6,847 Views
Message 29 of 28
Report

oh ok. Thx for tips and advice @Adam. will keep that in mind. been searching for this answer for some time

6,828 Views
Message 29 of 28
Report

How? I'm having the same issue and the support team is essentially useless...Thanks!!

5,926 Views
Message 29 of 28
Report
Square

Did you upload your image in the Assets folder, @charliedixon, and how are you linking to the image from your site?

5,923 Views
Message 29 of 28
Report

 @Adam I am also finding the same problem. I have uploaded the image to the assets folder and then inputed this code in the html section.

<img src="http://www.inpha.co/files/theme/YellowSquare.jpg" alt=yellowsquare"/>

not sure how to go about it now.

4,968 Views
Message 29 of 28
Report
Square

What is the address of your site, @Julia04? The example you gave is using the domain name from the other poster, and I assume you're working on a different site.

1,121 Views
Message 29 of 28
Report

Julia04,

https://www.yoursiteurl.whatever/files/theme/images/filename.extention

It requires the addition of an images directory after the theme directory.

1,007 Views
Message 29 of 28
Report

@Adam   I'm using some custom code from another source that's no longer available for support.  So I'm left with trying to fix some issues myself.  The site I'm working on is still in preview mode. Using the Code Editor, I've loaded some images in the Assets/image section; both jpg and png files. For some reason they're not showing up as expected.  The code that's controlling it is placed in the CSS main.less file.  The important part of the code is as follows:

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

The "yourimage.jpg",found in the parenthesis in the above code, is the actual name of the file and has been already loaded in the Assets/Image section. I also made sure I hit the save button in the Code Editor. As far as I can tell, the use of the "url", in the above code, doesn't need to change in that it is acting as a generic placeholder so that irrespective of whichever website this is on, it will default (i.e., point) to that website's url.  Any suggestions?

852 Views
Message 29 of 28
Report
Square

Are you using just "yourimage.jpg" for the URL, or "files/theme/yourimage.jpg"? Anything uploaded to the Assets folder will have the path of /files/theme.

850 Views
Message 29 of 28
Report

@Adam  Thanks for the reply. Using your suggestion, I just changed the line of code to: 

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

There was no change.
Any other thoughts?
849 Views
Message 29 of 28
Report
Square

Can you post a link to your site, @BKP? This would be a good question for the members of Community who are versed in CSS.

841 Views
Message 29 of 28
Report

@Adam Can I post a preview or does it need to be a published site?

839 Views
Message 29 of 28
Report
Square

I think a preview will be the same code-wise, so that should be ok.

838 Views
Message 29 of 28
Report

@Adam here's a preview of the site I'm having problems.  http://helpingsites.loginportal.site/preview/26036d.mfl93g7fe7m4f.9f15d286555c143c9d13bc8c7a459852

You'll see there's a carousel with names.  Right above each name the image is supposed to be there. The css calls for yourimage.jpg   Here's what it supposed to look like. image

Hopefully someone can figure out why it's not showing up.  Please review my prevous posts for details.

833 Views
Message 29 of 28
Report
Square

Thanks for posting. Adam is out but should be back on Sunday. I'll make sure he sees this post, though. Smiley Happy

821 Views
Message 29 of 28
Report

@Bernadette How can I engage the community with this issue?

1,113 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.