Welcome to WebmasterWorld Guest from 107.20.104.110

Forum Moderators: open

Message Too Old, No Replies

Linking images with Dreamweaver

jpg help and html

     
6:46 pm on Dec 23, 2006 (gmt 0)

New User

10+ Year Member

joined:June 19, 2005
posts:34
votes: 0


So I made a new website and my hosting company let me have it within my old website in a new folder.

The titles are fake but let's say the new folder is:

"sports"

within this folder is my new website, including index.htm, and a folder for pictures called "pictures"

when i link a picture using dreamweaver it directs it like so: img src="/pictures/burgerlogo.jpg"

but online it doesn't come up because the url becomes:

http://example.com/pictures/burgerlogo.jpg

it should be

http://www.example.com/pictures/burgerlogo.jpg

does anyone know how to fix this? even if i hand code it the code says img src="/pictures/burgerlogo.jpg"

how can i add a 'www' onto it?

thank you!

[edited by: encyclo at 8:02 pm (utc) on Dec. 23, 2006]
[edit reason] switched to example.com [/edit]

6:50 pm on Dec 23, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member eelixduppy is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 12, 2005
posts:5966
votes: 0


Why don't you call it relative to the current directory?

<img src="pictures/burgerlogo.jpg" />
7:05 pm on Dec 23, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


Well, this is the problem with WYSIWYG editors. Anyway here's your solution. Look:

The titles are fake but let's say the new folder is: "sports". within this folder is my new website, including index.htm, and a folder for pictures called "pictures"

when i link a picture using dreamweaver it directs it like so: img src="/pictures/burgerlogo.jpg"

What you want is to either 1)create a folder on your local drive called sports so you have /sports/pictures/burgerlogo.jpg and update your local pages, or 2) change your code so it reads /sports/pictures/burgerlogo.jpg.

The problem is not in http:// or [www....] The leading / means "wherever I am, start at the domain root." So it doesn't matter if you're using www or not:

http://example.com/sports/pictures/burgerlogo.jpg.
http://www.example.com/sports/pictures/burgerlogo.jpg.

Are led to the same place by
/sports/pictures/burgerlogo.jpg.

The advantage of using the leading slash: doesn't matter whether your file is at root or in a sub-sub-sub directory, the path remains the same. You don't have to count slashes and dots. :-) ../../../

9:58 pm on Dec 23, 2006 (gmt 0)

New User

10+ Year Member

joined:June 19, 2005
posts:34
votes: 0


Thanks for your help, it's driving me nuts

would i have to manually enter the url for the pictures?

let's say my sites look like this:

old site main folder
- old site index
- old site picture folder
- old site content
- new site
- new site index (within new site folder)
- new site picture folder (within new site folder)
- picture (within new site picture folder)

and i wanted to get the picture in the new site picture folder to appear, on my new site domain name

dreamweaver is listing it simply as href- /new site picture folder/picture

but it's not coming up

should i put the whole url in the code like: [old...] site.com/new site/new site picture folder/picture.jpg?

will i have to do this for every single picture?

when i click on my image in dreamweaver it says (among other things):
file name: picture
files of type: image files

url: /new site picture folder/picture.jpg
relative to: site root

[edited by: Gomideast at 9:59 pm (utc) on Dec. 23, 2006]

10:01 pm on Dec 23, 2006 (gmt 0)

New User

10+ Year Member

joined:June 19, 2005
posts:34
votes: 0


also, when i put the url in my browser address bar, such as:

[new...] site.com/new site picture folder/picture.jpg

the image comes up fine, alone, but it's still listed at that address and is (therefore? i assume?) hosted at that address and should appear within the site as well?

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members