6

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?

defau1t
  • 10,593
  • 2
  • 35
  • 47
JonoB
  • 5,801
  • 17
  • 55
  • 77
  • Right, for some reason, cssmin seems to be prepending a url when the css is minified on the live server. So, url(../images/background.png); becomes url(/test/assets/images/background.png); I need to investigate more – JonoB Feb 21 '12 at 20:12
  • Bah, it appears that cssmin was indeed prepending a url when it did not need to. – JonoB Feb 21 '12 at 20:21

1 Answers1

11

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.

NG_
  • 6,895
  • 7
  • 45
  • 67
Spyros Mandekis
  • 984
  • 1
  • 14
  • 32