Relative path: parent directory


In this exercice, the relative path to the font-family is


Why? since “fonts” is in the same file as " index.html", fonts/Glegoo-Regular.ttf should be enough no?


The fonts folder is in the same directory as index.html, yes, but to access it from inside the css folder, we need to get back into its parent, then traverse into the fonts folder.

src: url(../fonts/Glegoo-Regular.ttf) format('truetype');


so it is because style.css is in “styles” folder so we need to go back to their parent folder.

But if style.css wasn’t in a folder, just “fonts/Glegoo-Regular.ttf” would do. Did I get the logic right?


Safe to say, yes. It depends where the CSS file is. The path needs to be relative to it, not the index.html file.