logo-dw

Go Back   Dreamweaver Club Forums > Graphic Design > Web Design
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 08-04-2011, 11:18 AM   #1
Tim.g
 
Join Date: Aug 2011
Posts: 2
Default File paths, absolute / relative

Hi,
I am new to dreamweaver & webbuild in general. I am in the process of building a site for my sisters business but have a problem.
When I transport the work to a stick then to another PC, it is all displaced. I have been told I need to make all paths relative rather than absolute but havent got a clue how to change this, Can anyone please help?
Tim.g is offline   Reply With Quote
Old 08-04-2011, 12:16 PM   #2
Corrosive
Corrosive's Avatar
 
Join Date: Feb 2008
Location: Bristol, England
Posts: 7,103
Default

Example absolute (to an image but same principals apply);

Code:
 <img src="http://www.yourdoamin.com/images/yourimage.jpg" />
Example relative (relative to the site root folder)

Code:
 <img src="images/yourimage.jpg" />
Hope that helps; http://www.corrosiveonline.co.uk/tut...file_paths.php
Corrosive is offline   Reply With Quote
Old 08-04-2011, 12:43 PM   #3
Tim.g
 
Join Date: Aug 2011
Posts: 2
Default

Thanks for the reply, but I am still a bit confused as in my coding for say the header image I have got:
<img src="../shopfront re-size.jpg" width="899" height="108" />

Your example for relative seems to show the containing folder and the image. Whereas mine shows the image & size only.
Tim.g is offline   Reply With Quote
Old 08-04-2011, 12:54 PM   #4
Corrosive
Corrosive's Avatar
 
Join Date: Feb 2008
Location: Bristol, England
Posts: 7,103
Default

Did you read the page I linked as well? It is good practice to have a logical site structure, images in an images folder, scripts in a scripts folder, CSS in a CSS folder and so on. If you put your images in an images folder then your path would look like my first example.

basically though, just trace the path to what you want to link to and then construct your links. Then you could use something like 'Find & Replace' to batch run the whole site.
Corrosive is offline   Reply With Quote
Old 08-04-2011, 02:18 PM   #5
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

Quote:
Originally Posted by Corrosive View Post
Example relative (relative to the site root folder)

Code:
 <img src="images/yourimage.jpg" />
Not exactly. That link is relative to the current location. To have the link relative to the site root folder, you add a backslash to the start of the :

Code:
 <img src="/images/yourimage.jpg" />
domedia is offline   Reply With Quote
Old 08-04-2011, 02:21 PM   #6
Corrosive
Corrosive's Avatar
 
Join Date: Feb 2008
Location: Bristol, England
Posts: 7,103
Default

Quote:
Originally Posted by domedia View Post
Not exactly. That link is relative to the current location. To have the link relative to the site root folder, you add a backslash to the start of the :

Code:
 <img src="/images/yourimage.jpg" />
Ooops, yes. Coded that in a rush
Corrosive is offline   Reply With Quote
Old 08-04-2011, 07:42 PM   #7
DWcourse
DWcourse's Avatar
 
Join Date: Apr 2009
Posts: 3,276
Default

If you move the site to a new computer AND redefine the site on the new computer you should be able to preview from Dreamweaver no matter what type of links you use.

If you want to be able to view the site directly in your browser on another computer or from a flash drive or cd you need to use document relative links.
__________________
If my answer helped, check out DWcourse.com for Dreamweaver tips and tutorials.
DWcourse is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:33 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com