i am working on a website and creating my own gallery.
However there seems to be a little problem with the code.
i wanna add my picture from my computer so it has the right width and heihgt.
here is the code.I tried to do cover in css but some images are too big and wont fit.Thank you for reading.
$('#gallery').css("background-image", 'src=C:\Users\Eigenaar\Desktop\Nieuwe map\luffy');
//luffy serieuse kop
//luffy lachende kop
The image path you use shouldn't be the actual path of the image on your computer, it should be the path that the specific html file you're in would use to get to the image.
Your link here is the problem:
For example, if I had a directory that contained:
index.html could display
However, imagine I have a directory where index.html is on the same level as a directory called "images" which contains your image file, like this:
index.html images img.jpg
Then, in order to display the image I would use
Most of the time, people have a folder with all of their website images in the same folder as their index.html file so they can pull directly from the folder.
Hope this helps!
Bonus learning note:
.. means "go up a directory". This is useful if you can't directly access the images folder from your html file. For example, if your directories looked like this:
html index.html images img.jpg
You would first have to go up a directory before entering the
images folder and displaying
img.jpg. Then, your file path would be