Different CSS background-image depending on month and year
问题 Basically, I have a div with text in it, and I want the background to display a different image depending on what month and year it is. How can I achieve this? Any help would be greatly appriciated! *I've prepared 4 years worth of monthly images labelled "month0_2011.png" to "month11_2014.png" already if that helps?* 回答1: Add a .php extension to the CSS and use PHP code to determine that. Just use standard PHP tags. For example: body { background-image:url('<?php echo $currentImagePath ?>');