How do I change a CSS bakground on refresh?

Posted on 2009-07-03
Last Modified: 2012-08-14
I have a drupal site located at and I want to be able for the background image on the front page to change when refreshed.  I have 10 or so images that are all the same size in my gallery, under the album Backgrounds (rotating).  Is there a way to call a php script in the CSS file that will randomly select an image from that album?  Or would it be simpler to call a file from a directory?

Question by:meinemitternacht
  • 3
  • 2

Expert Comment

ID: 24771855
I think its easier to use php.
Check this out
LVL 17

Accepted Solution

selvol earned 500 total points
ID: 24771872

Author Comment

ID: 24773491
Thank you very much Selvol, hit it right on the money.  Mallcore, that's way over my head :)
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.


Author Closing Comment

ID: 31599535
Thanks a ton!
LVL 17

Expert Comment

ID: 24776583
Glad to assist..
Yes, over our heads.....??

Author Comment

ID: 24776588
Over my head... means too complicated for me :)

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PHP Mail error 3 28
Ahax pagination 9 34
Bootstrap list items overlap 3 12
Drop Down not working in mobile- Bootstrap 14 13
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question