Links

How to put a links to picktures, because default background: url(“img/img.png”) doesn’t work?

Hi and welcome to the forum
It should work

Your sample code is about CSS - Is that inline style or from an external CSS ?

If it is from an external CSS - then you have to take care of scope
The path should be relative to the CSS file position
(imagine that you are looking at the eyes of that CSS file and where the image file is located from you)
One, two, three, etc. levels up or down or in same folder where is image file…

https://www.w3schools.com/html/html_filepaths.asp

Also clean browser cache (CTRL + F5)

in addition
unix based systems are case sensitive (vs Windows OS)
dummy.png is not been treated as the same file as DumMy.png or dummy.PNG

If the question is related in general for HTML images
https://www.w3schools.com/html/html_images.asp

Ty for answer! I’m trying to make a background in externam css file (i made a link for it) and new i can’t understand how to make a link for image (background), “index” file is on the same level as “img” folder and in folder is “img.png” but url(“img/img.png”) doesn’t work.
I know about case sensitivity

But it is important where is that CSS file (It will doing a search for a image)

Example
if your external CSS file is in this location
root/css/style.css

and image is in this location
root/img/img.png

Then in your CSS file should be this URL
background: url(“../img/img.png”) = go one level up (out from css folder to root) and search for folder img…etc.

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