Return to Help Center

Welcome to the Bravenet Help Forums. Here you can chat and meet other Bravenet Members. Please do not post advertisements.

Forum: Coding Discussions
Start a New Topic 
  
Author
Comment
code for image links when images are in separate directory

I am very new to bravenet, and I have just uploaded a website to web hosting. All the files work perfectly on my pc, but I am finding that some of the images aren't loading in the bravenet platform. Some are. This is a little confusing, lol.

My images are stored in a separate directory named Images, and I have been using the following code to link to them:

html:
img src="./Images/Logo.jpg" (<> excluded in this post because of message settings)

OR

CSS:
background: url("./Images/balance-double.jpg") top center;
This image works. Size = 1916px x 1917px

background: url("./Images/church1d.jpg") no-repeat top center;
This image doesn't work. Size = 1350px x 781px

All of the other images are within the same size range, the same file types, and the same CSS structure, etc.

I'm not sure if this is just a delay within bravenet itself, or if there is something wrong with my coding. Any input would be gratefully received.

Thanks.

Re: code for image links when images are in separate directory

Quote: johnyjohnson
you could try ..
img

click on quote to see the code.

Email  
Re: code for image links when images are in separate directory

Thanks for that suggestion.

Unfortunately, it didn't work.

Re: code for image links when images are in separate directory

It's really quite simple, take out the . before the /image tag.

Code:
<img src="/image/??jpg>

the . is looking at your directory being a step above the one you are trying to access. meaning there should be nothing higher than your root directory so image is a second level directory.

Re: code for image links when images are in separate directory

Quote: johnyjohnson
Quote: johnyjohnson
you could try ..
img

click on quote to see the code.


This is looking to move up two directories.
IF you are in your web/root/ folder your tree should look something like this

your site
__ img
__ forms
index.php
header.php

If you are in the forms folder and want to access an img folder you type ./img
the . representing moving up one directory to the root then accessing the /img directory. If you were in the forms directory in a directory inside forms, it would need to go up 2 levels to get to the image and that would read as ../img

Hope this helps you understand how the directories work.

Re: code for image links when images are in separate directory

Quote: TWStyles
It's really quite simple, take out the . before the /image tag.
Code:
<img src="/image/??jpg>

the . is looking at your directory being a step above the one you are trying to access. meaning there should be nothing higher than your root directory so image is a second level directory.


Thank you very much for your 2 replies. They are very helpful in understanding the navigation side of directories.

I really thought I had the answer to my problem, but ... sigh ... my images still aren't loading.

The strange thing is that all the images on one page have loaded, and half the images on another page have loaded, but none of the others. It's very confusing and frustrating!

I really appreciate your helpful response.

Re: code for image links when images are in separate directory

I have a solution!

Thank you all for your input. It's great when we can help each other out - even if it doesn't always work.

What was going wrong was that my image files were saved as .JPG, but my links to the files were typed as .jpg. After submitting a support ticket, I discovered that the file types are case sensitive, so the links weren't finding the correct files. I have corrected this now, and everything is working fine.

I corrected the ./ re the directories, as well, and this has also helped tremendously.