Did we stop using ../?

Im learning Sass off a YT video from 2019. I see the guy write background: url(../img/img-1.jpq
I write the same but get a 404 error saying the file isn’t found. However, I edited the line to read background: url(/img/img-1.jpq) & I found this to be the solution. So did we stop using …/ also I know 100% my file structure is the same as the guys in the video. All my folders were exactly where his was.

I find this syntax confusing because ../ usually refers to the parent file paths/directory but the background: url(…) requires a URL.

That says start from the root directory.

url(../ says go back one level.

Usually css in a css folder so you would need to come out of the css folder to find the image folder and then you would use url(../img/ etc…

2 Likes

I do not know who we are but the syntax ../ was in use many years before the internet. I do not know if Unix was the first operating system using that but Unix certainly does and it is nearly half a century old. Linux of course conforms to Unix’s use and so does DOS and Windows, except DOS and Windows of course uses a backslash instead of forward slash.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.