The question asked is: Where is the “img” folder???
Currently, your css file is looking for the “img” folder in its css directory like this:
yourfile.html
css/cssfile.css /* path to image: img/slogan.png */
css/img/slogan.png
Absolute vs Relative paths:
/img/slogan.png is an absolute path to the image.
img/slogan.png is a relative path to the image.
yourfile.html
/img/slogan.png /* these folders are in the root directory /
/css/cssfile.css / path to image: /img/slogan.png , or …/img/slogan.png */
yourfile.html
img/slogan.png /* these folders are in the same directory as the html file, which may not be the root directory. /
css/cssfile.css / within this css file, the path to the image may be different than in the above css file // path to image: …/img/slogan */
[ot]Over time, around here, there have been arguments over whether something like
/img/slogan.png
is actually “absolute” or not. I used to call it that, but the panditas have now convinced me to call it a “root relative” path, and to reserve “abolute” for paths of this ilk:
It’s “absolute” because it works from anywhere—on any site. Seems fair enough to me. The other paths are relative to the site itself, but not universal, as it were. :)[/ot]
When I wrote the post I had put (root relative) in parens, but deleted it to avoid mixing “relative” terms. While “root relative” is certainly a reasonable term, I would argue that including the URI in a path makes it a network path rather than an absolute path. The internet is fundamentally a massive network. Taking a very-well-established computer design/engineering term and deciding that it is now the domain of the internetters to redefine as they please seems a bit weird. Network path is far more correct than absolute path. Oh, well.
Edit:
A network path can be directed anywhere. http://sitename can be routed anywhere. There is nothing “absolute” about it. It’s ethereal at best. An absolute path is a hardware path that is indeed root relative and cannot be changed. Adopting the term absolute path for one that begins with http:// does not seem very smart.
Yes, you have a larger view of it than I do, but meh, I claim to be only the messenger here. I guess I think in terms of a URI being a uniform locator that is unique to that resource, so I think of it as absolute in that sense—that it points to one place/ one unique location from any point.