Results 1 to 2 of 2

Thread: random images using css

  1. #1
    Join Date
    Feb 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default random images using css

    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.

  2. #2
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    You can't do that with CSS, you will have to use JavaScript or PHP or some other script language.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •