Log in

View Full Version : random images using css



msix
02-27-2009, 07:51 AM
I'd like the viewer to see a separate image each time the page is visited. I'm using a div id and am setting the image using the background property. I have several styles already setup called photo1, photo2, photo3, etc. that have a different background image declared in each.

HOW do I get the name generated (photo1, photo2, photo3, etc) and passed into the HTML code along the lines of <div id="photo1">?

Thanks for your time.

Snookerman
02-27-2009, 08:27 AM
You can't do that with CSS, you will have to use JavaScript or PHP or some other script language.