(2) Relative URLsWith relative URLs, the link is seen as relative to the current document. You've been doing it already tells the browser to get nextpage.htm which is in the same folder consider this web site example The main folder contains both webpage (.htm) files and 4 subfolders (images, tech, shop & help). Both shop and tech subfolders have there own subfolder levels. Image acts as the repository for all graphic files used on the site Say you have a page called start.htm in the main folder. Linking to another file in that folder is easy (e.g. <a href="nextpage.htm). If you want to link to file called list.htm in the parts subfolder of the tech subfolder your link would look like <a href="tech/parts/list.htm"> that makes the browser looks in the tech subfolder for the info subfolder containing the file list.htm To go back the link would be <a href="../../start.htm"> each ../ tells the browser to go back up the directory root (here we go back 2 folders to main one) and find the file in that. See if you could work out the relative link from list.htm in parts to a file called phone.htm in the info subfolder. The same thing works for graphics src attributes for example lets say all files would use an image called logo.gif which is in the images folder On the start.htm this would be <img src="images/logo.gif"> Whilst with list.htm it would be <img src="../../images/logo.gif">
|