简体   繁体   中英

Background image works in live server, but doesn't work in Xamp

Here is a picture of my file paths. I'm making a personal Portfolio page for a class assignment, 90% of the work was done using VSCode liveserver to check my progress, however i needed to add php to handle my forms, I started viewing my site using xammp to track my progress with the database. However before i could get to that my background image refuses to load. I've checked the url path over and over and i cant see the problem.

 //code that works while using liveserver.banner-wrap { background: url(/imgs/caspar-camille-rubin-fPkvU7RDmCo-unsplash.jpg) no-repeat center center/cover; z-index: 0; } //code that SHOULD work in xammp.banner-wrap{ background: url('../imgs/caspar-camille-rubin-fPkvU7RDmCo-unsplash.jpg') no-repeat center center/cover; z-index: 0; }

OP here, so I've solved the issue, but i have no idea why it's working now. All i did was open Chrome Developer tools and post the same file path from my css into the chrome developer css, reload the page and the background was there. From then on the file path in my css seems to work as intended without me changing a line of code in my files. If anyone knows why this solution works please let me know. Very satisfied with the results, equally confused

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM