80 likes | 262 Views
Files and Directories. How files are organized. HTML files and paths. How your code refers back to it’s content Relative vs. absolute Relative to the root or relative to the referring document < img src =“http://simpsons.com/images/homer.jpg” /> < img src =“images/homer.jpg” />
E N D
Files and Directories How files are organized
HTML files and paths How your code refers back to it’s content Relative vs. absolute Relative to the root or relative to the referring document <imgsrc=“http://simpsons.com/images/homer.jpg” /> <imgsrc=“images/homer.jpg” /> <imgsrc=“/monkeys.jpg” /> <imgsrc=“/temp/homer.jpg” />
The “root” of a website • Sometimes /web/ sometimes / • It is the beginning of the site and the directory holding the site. • A link to /folder2/file1.html is a link relative to the root of the folder.
Same Directory • Just the name of the file: • <imgsrc=“homer.jpg” />
Image in a folder in the same directory: • Just the name of the file: • <imgsrc=“images/homer.jpg” />
Image in a folder ABOVE the current directory: • Just the name of the file: • <imgsrc=“../homer.jpg” />
An absolute URL • shows the entire path to the file, including the scheme, server name, the complete path, and the file name itself • Like a street address • A relative to the document URL • points to the location of the desired file FROM THE FILE THAT CONTAINES THE URL. • Instead of an address, • Like saying “three doors down”, or “image xyz that is in the same directory as this file” • When working within pages you can reference pages & items within the same directories. Absolute & Relative URLs