I am developing on my localhost - http://localhost/mysite, and within that I have the following directory structure:
-assets
--css
---styles.css
--images
---background.png
Within the styles.css file, I would have something the following, which works fine on localhost
background-image: url(../images/background.png);
However, the live server works off a subdomain - http://test.liveserver.com. This means that the css rule has to change as follows:
background-image: url(/assets/images/loginlogo.png);
Not sure on the best way to get around this?
With the directory tree you are providing you don't have to change your path.
..
means the parent directory of the CSS file so the assets/
directory is implied.
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