I added the images into the folder called "images" and CSS to folder called "css", now I want to use the images in "images" folder. How do I do this? When I used this, they didn't show up:
background: url('/images/bg.jpg');
I also tried these:
background: url('../images/bg.jpg');
background: url('../../images/bg.jpg');
What is the path I should be using to access my images?
If you have a folder structure like follows:
/public_html/
/css/
/images/
/index.html
Then your CSS should work.
- Starting with "/" returns to the root directory and starts there
- Starting with "../" moves one directory backwards and starts there
- Starting with "../../" moves two directories backwards and starts there (and so on...) To move forward, just start with the first
subdirectory and keep moving forward
Read more here: http://css-tricks.com/quick-reminder-about-file-paths/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With