random background image

Discussion in 'CSS' started by agones.eu, May 30, 2009.

  1. #1
    Hello everybody,

    I just recently opened a blog (www.agones.eu) and I'm totally new to CSS, that's why i'm here to ask for your help. I want that the background of my blog would change randomly now and then, but I don't know ho to do it. I found the plugin:

    http://www.district30.net/random-image-widget


    and it says I should use a function called echo_random_image(); but I don't know hot to use it.

    I think I should insert it in my style.css file?

    here's the background part:

    
    
    /*++++++++++++++++++ The BACKGROUND IMAGE +++++++++++++++++++++*/
    
    /*+++++ replace "(images/default.jpg)" with another image from the /images directory of the theme or use the custom background switcher (Appearance - Change Background Image) ++++*/
    
    
    
    body {
    
            background: url(images/hill.jpg) no-repeat 0 0 #fff;
    
            background-attachment:fixed;
    
            background-position: bottom center;
    
            color: #000;
    
            font-family: Arial, Verdana, sans-serif;
    
            margin: 0;
    
            padding: 0;
    
    }
    
    
    
    cite {
    
            font-size: 90%;
    
            font-style: normal;
    
    }
    
    
    
    h1 {    
    
    		font-size:20px;
    
    }
    
    
    
    h2 {
    
            
    
    		font-size:18px;
    
    
    
    }
    
    
    
    h3 {
    
    		font-size:16px;
    
    }
    
    
    
    h4 {
    
    		font-size:15px;
    
    }
    
    
    
    h5 {
    
    		font-size:14px;
    
    }
    
    
    
    h6 {
    
    		font-size:13px;
    
    }
    
    
    
    p, li {
    
            font: 13px 'Arial', Verdana, sans-serif;
    
            line-height:17px;
    
    }
    Code (markup):
    how should I modify it?

    thank you very much.
     
    agones.eu, May 30, 2009 IP
  2. CoryR

    CoryR Active Member

    Messages:
    68
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    70
    #2
    That's far more easier to accomplish with JavaScript.
     
    CoryR, May 31, 2009 IP
  3. pod

    pod Peon

    Messages:
    55
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I would use rid.php for this - you just drop the script into a directory with the images you want to randomize and then refrence it in your HTML or CSS just like you would an image, ie "/path_to_the_script_folder/rid.php?pic=random" instead of "/images/imagename.jpg". This is one of my favorite little scripts and has been for years - very simple, very useful.

    Hope this helps!
     
    pod, Jun 3, 2009 IP