PDA

View Full Version : Another - Images not displaying in browser but are fine in DreamWeaver


Chapster5
07-16-2012, 08:31 AM
Firstly Hi guys i'm new here I am more a hobbyist than professional and do get stuck on some of the most simplest problems I will admit but here's one that was bugging me last night

So I am making a Joomla template for a friend, all images i'm using are in /images folder, the links to background images in the CSS words fine say ../images/background.png

but if I put an img tag in the html side of things say

<ims src="../images/logo.png" />

It displays in Dreamweaver superb! How ever in the browser I get the little white square red cross. The image say logo.png is in the images folder and I am running it on XAMPP if that helps. If I put in the full address to the image

../htaccess/john/templates/daft-craft/images/logo.png

It works in the browser but doesn't display in Dreamweaver

I am so confused I can't use the full address as when I upload it to a live server then address to the image will be wrong.

Just seems the CSS Background-image tag finds the image and displays it yet an image tag in the index.php file wont?

Any help would be appreciated to shed light on this situation :) Thanks guys!

Corrosive
07-16-2012, 08:36 AM
Just go through your folder structure and image paths with a fine tooth comb. If your images are where they say they are on your remote server then it must be incorrect paths.

edbr
07-16-2012, 08:41 AM
looks like a complicated site structure and not defined properly. you should have a root directory for your site and images a folder in that directory (when i say should i mean normally) then the path will be correct but
../htaccess/john/templates/daft-craft/images/logo.png is a lot of containing folders

Chapster5
07-16-2012, 08:47 AM
Thanks for the reply guys,

In dreamweaver I have the folder

daft-craft

set as my main folder (my root) as it's the template folder.

The john folder is the root of the whole site, the rest is the joomla structure

templates is where all the individual templates are stored

daft-craft (this is the folder name for my template) which is set to the root for dreamweaver as said

Is it anything to do with the way XAMPP works?

Ive even tried getting rid of the ../ and just having images/logo.png

The Hierarchy of the daft-craft folder goes like this:

daft-craft
|-css
|-images
||-logo.png
index.php

Thank you

Chapster5
07-17-2012, 07:46 AM
Sod it,

I just made it as a background image for the div <div class="logo"> LOL Saves me a headache nothing else is going to be put in the div or anything so makes sense. :)

Cheers anyway guys!

domedia
07-17-2012, 01:02 PM
Remember that the path to the image from your CSS file is relative to your CSS file, and not the HTML file where you link to your CSS.

Chapster5
07-17-2012, 01:13 PM
Ahhh thats probably why then, I should point the image address to

/templates/daft-craft/images/logo.png

There is an index.php inside the daft-craft folder (the one that holds all the page layout) but the actual main site index.php file is under the folder john (or the root of the whole site)