When you ask a question, don’t forget to include a link to the exercise or project you’re dealing with!
If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. That way you’ll be helping everyone – helping people to answer your question and helping others who are stuck to find the question and answer!
While I am taking a course for CSS,
I found path (…/fonts/Glegoo-Regular.ttf)
Well As I don’t know what …/ stands for, so I just used the hint without knowing what it actually means.
Also I saw some lines like this ‘./’ .
I know it’s related with file path, yet Still getting confused. I even try to google it, but not shown on search bar.
From what I can gather, when the relative path specifies a file in the same directory, the ./ is optional - is that correct?
e.g. When we are linking to a file style.css from a file index.html, and both files are in the same directory, my understanding is that we can write either of the following:
<link href="./style.css" rel="stylesheet">
OR
<link href="style.css" rel="stylesheet">
What I’m more unclear about, is whether the ../ is also optional when the relative path needs to specify a file in a different directory, but within the parent directory…
For example, in CSS Typography - Font-Face III, we are asked to add an src declaration to an @font-face rule set, which has a relative path to a file in a different directory (fonts) within the same parent directory.
points to the site root, if a web server, else the volume root if our own computer. This will not do since our project here is buried in a path of several directory levels.
"fonts/Glegoo-Regular.ttf"
assumes fonts is in the same directory as index.html.
Thanks, that’s really helpful… the only things I don’t understand from your reply are “site root” and “volume root” (but I get the basic idea that just using the forward slash won’t work )
site root is the directory mapped to a domain’s home page.
example.com/index.html
volume root refers to the lowest directory of your hard drive, as in C:\. On our local system we generally keep our files in a user documents directory which is not on the volume root.