There's a way to set a default directory for the images used in css? -


i have css file which, organizational sake, in directory 1 images are. thing end setting background-images this: background-image: url(../img/untitled.jpg). there's html's <base> tag can used in css don't need put "../img/" every single background-image?

another possible option create styles using or server side language. can use directory variable spit out full path each item.


styles.php

<?php     header("content-type: text/css");     $imagedir='../images';     // or     // $imagedir='/newsletter/2010/jan/17/business/category/7/img'; ?>  .divclass{     background : url('<?php echo $imagedir; ?>/kitten.jpg'); } 

Comments