How can I get HTML/CSS to display a randomly selected image?

Hi guys,

I’m using Dreamweaver MX 2004 to create an HTML website.

I have a series of header images in a folder all with the same dimensions. What I want to be able to do is have one of these images, selected at random, to appear in a certain place everytime a new page is loaded.

From what I know, I believe this may be possible using CSS?

Any help would be much appreciated. Thank you very much and I hope to hear from you.

All the best,

Mark

you need to either use something server-side like php or asp, or something client-side like javascript. css and html alone won’t do it.

using javascript I would place the images in an array and then randomly select one from the array

try here for help
http://www.w3schools.com/js/default.asp

but it can’t be done with just CSS, using Javascript though does make it DHTML so if you know HTML & CSS, learn javascript and it means you can add DHTML to your CV…2 for 1 :thumb:

that’s brilliant!

thanks guys - much appreciated.

all the best,

mark