Finals File Path

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/22

encourage image

There's no tags or description

Looks like no tags are added yet.

23 Terms

1
New cards

What is a file path?

A string that describes the location of a file within a website's folder structure.

2
New cards

How do file paths function across different operating systems?

They are consistent, meaning file paths used during development on one OS will function the same when deployed to another.

3
New cards

Which HTML elements utilize file paths?

4
New cards

What is an absolute path?

It provides the full address to a resource, including the protocol, domain name, and the entire path to the file.

5
New cards

What does an absolute path start with?

It starts with https:// or http://.

6
New cards

When should you use an absolute path?

When referencing external resources or specifying full URLs for canonical links.

7
New cards

When should you avoid using an absolute path?

During local development, as it ties files to a specific domain.

8
New cards

What is a relative path?

It specifies a file's location in relation to the current HTML file's directory.

9
New cards

What does a relative path start with?

Nothing, a folder name, or ../.

10
New cards

When should you use a relative path?

For local projects or deployments where the folder structure is expected to remain consistent.

11
New cards

What is a root-relative path?

It starts from the website's root directory, regardless of the current HTML file's location.

12
New cards

What does a root-relative path start with?

A forward slash (/).

13
New cards

When should you use a root-relative path?

When all files are organized under a common root on a web server.

14
New cards

What is a protocol-relative path?

It starts with // and allows the browser to automatically use the same protocol (HTTP or HTTPS) as the current page.

15
New cards

When should you use a protocol-relative path?

When you want a resource to load over HTTPS on an HTTPS page and HTTP on an HTTP page.

16
New cards

What is a modern practice regarding protocol-relative paths?

They are less commonly used now as modern web development favors explicitly using HTTPS for all resources.

17
New cards

What is a common use for a relative path?

Local files within a project.

18
New cards

What is a common use for a root-relative path?

Larger sites with deeply nested files, when consistency from the project's root is desired.

19
New cards

What should you avoid with root-relative paths?

They do not work reliably when opening local files directly in a browser.

20
New cards

What is an example of an absolute path?

21
New cards

What is an example of a relative path?

22
New cards

What is an example of a root-relative path?

23
New cards

What is an example of a protocol-relative path?