Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Nov 2010
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    load a different image on every page load

    How can I display a different background image every time my page loads? These images will be wider/taller than the viewing area when being viewed with smaller screen resolutions, so I need the images to be centered vertically/horizontally across the browser window, with the center of the images being in the center of the viewing area, no matter which screen resolution the visitor has..

    Normally for just a single bg image I'd use:

    Code:
    body
    {
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    }
    But how can I achieve this same effect for multiple, randomly picked, bg images?

  • #2
    Mr.
    Mr. is offline
    Regular Coder
    Join Date
    Feb 2011
    Posts
    112
    Thanks
    8
    Thanked 4 Times in 4 Posts
    I see you have posted 36 times but have thanked no one... I could explain how you can do this if you can explain that.


  •  

    Posting Permissions

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