Forum Moderators: not2easy

Message Too Old, No Replies

Variable CSS background image URL

         

Blutarsky

2:47 pm on Aug 7, 2010 (gmt 0)

10+ Year Member



Is there a way to allow a background image URL in the stylesheet to be variable, depending the running host?



.sprites {background: url(img/index.png) transparent no-repeat top left;}


I mean, an option could be to use 2 stylesheets, using PHP to choose which one to load depending on the running host, however I'd rather prefer to use just one

Major_Payne

2:04 am on Aug 8, 2010 (gmt 0)



This would be more of a server-side script to detect and switch according to the browser's referral information provided I didn't misunderstand. Not so much a CSS thing. JavaScript can be used for switching CSS files dependent on the information browsers provide.

Blutarsky

7:53 am on Aug 8, 2010 (gmt 0)

10+ Year Member



Yeah, probably the tool use to deploy sources from the test environment to the release environment could do this...