Section 4 - Multi-Page Websites Flashcards
What is the Root?
the starting point of a computer’s filing system (hard drive)
What is an absolute file path?
a path relative to the root of the computer
Windows: C: Drive
Mac: Macintosh HD
Whats an example of an absolute file path for Windows for the file cat.png in the Images folder under Project?
C:/Project/Images/cat.png
What is a relative file path?
when you specify a path relative to where you’re currently writing your code (usually shorter than absolute paths)
What type of files will usually use a relative path? (4)
- Images
- Sounds
- Movies
- Other HTML files
What’s an example of a relative path?
Scenario: You’re currently in index.html, and there is another folder in the directory called Images with cat.png inside you want to specify
Current: index.html
Images/cat.png
What are the special characters that let us navigate relative file paths?
double dot ..
single dot.
What are double dots and what do they allow us to do? Where are they located in a file path? (2)
double dots allow us to go up a level in a relative file path, placed at the beginning of the file path
Ex:
../essay.docx
(the dot dot .. equals the parent directory above, and the file represents the file you want to access that’s above you)
What does the single dot allow us to do in a relative file path?
it tells us to stay in the current directory (that we’re in)
What’s an example of using the single dot file path with dog.png?
./dog.png
What’s a trick you can do if you want to access anything in the current directory and same hierarchy (same parent and any child in current directory)?
You can omit the dot slash ./
Ex: ./dog.png = dog.png
(but doesn’t work all of the time so always use the dot slash ./ )
How would you type out that you want to stay in the current directory?
./filename.png
When creating image elements don’t forget the important…?
alt text
(goes before ending slash greater than />)
dot slash takes us to the ____ level
parent level (current directory)
dot dot slash takes us ______
up a level (to the Root)