Yes, paths can be confusing. (non-technical explanation to follow)
The are file system paths eg. āC:/folder/folder/fileā
And HTTP paths eg. āhttp://somesite/index.htmlā
They look similar, and things get more confusing when you consider that
URIs (resource Indentifiers) look like URLs (resource Locators) but donāt need to be ārealā
Some times Case matters, some times not.
Some OS use forward slash /, some backward \, sometimes either will work.
Anyway, a typical live site structure is like
/ your host account folder
. . . / āprivateā folder accesible to code only, not browsers
. . . / public ārootā folder
. . . . . index.html
. . . . . htaccess
. . . . . robots.txt
. . . . . favicon.ico etc. etc.
. . . . . / css folder
. . . . . . . sitestyle.css
. . . . . / javascript folder
. . . . . . . sitescript.js
. . . . . / image folder
. . . . . . . logo.jpg
. . . . . / sub folder
. . . . . . . / sub sub folder etc. etc.
The easiest thing to do is to have every file that needs each other in the same folder.
But this can quickly make a folder have so many files it makes things harder instead of easier.
And if, say, ālogo.jpgā, āsitestyle.cssā and āsitescript.jsā were to be used in sub folders and sub sub folders, there would be multiple copies of those files. If a change to a file was made, changing them all could be a problem. Even if not a problem, it gets old fast, believe me.
Organizing things helps, and how itās done can be different, so basically itās do it the way it needs to be done if you must, else the way that works best for you.
Absolute paths eg. āhttp://somesite.com/images/logo.jpgā always work but can get rather long.
ārootā paths work OK and are often the preferred way eg ā/images/logo.jpgā
Relative paths work, but require an understanding of where things are in relation to each other eg.
from root folder ācss/sitestyle.cssā,
from sub folder āā¦/css/sitestyle.cssā,
from sub sub folder"ā¦/ā¦/css/sitestyle.css"