Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: how do I turn my bg color to look like a gradient image?

  1. #1
    Join Date
    Jan 2008
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how do I turn my bg color to look like a gradient image?

    1) Script Title: gradient image

    2) Script URL (on DD): http://tools.dynamicdrive.com/gradient/

    3) Describe problem:

    How do I turn my bg color to look like a gradient image? I want the background color of my rss scroller to be like a gradient color.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    It depends on the dimensions of the RSS scroller, but assuming it's long in width and shorter in height, you'd want to tile the gradient background image horizontally. Using global CSS, something like:

    Code:
    #rssdivid{
    background: white url(gradient.jpg) top left repeat-x;
    }
    The gradient image is assumed to be a slim and tall image, for example, 5px width by 300px height.

  3. #3
    Join Date
    Jan 2008
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you looks simple enough and yes its wide and short. But do I have to remove any of the script that deals with the back ground from the original before I insert your suggestion?

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    It depends on which script exactly you're talking about...

  5. #5
    Join Date
    Jan 2008
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    the script that sets up the scroller box that comes with the demo.

    *Example CSS for the two demo scrollers*/

    #pscroller1{
    width: auto;
    height: 100px;
    border: 1px solid black;
    padding: 5px;
    background-color:lightsteelblue;
    }


    .rssclass .rsstitle{
    font-weight: bold;
    }

    .rssclass .rssdate{
    color: black;
    font-size: 85%;
    }

    .rssclass a{
    text-decoration: none;
    }

    </style>

  6. #6
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Inside #pscroller1, you'd have something like:

    Code:
    #pscroller1{
    width: auto;
    height: 100px;
    border: 1px solid black;
    padding: 5px;
    background: white url(gradient.jpg) top left repeat-x;
    }

  7. #7
    Join Date
    Jan 2008
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hmm..unfortunately all that gave me was a white background

  8. #8
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Where it says gradient.jpg, it has to be an existing image. You can use the gradient image tool here on DD, or make your own using image creation software. To change the background color if there is no image, simply change the below code in red.

    Code:
    #pscroller1{
    width: auto;
    height: 100px;
    border: 1px solid black;
    padding: 5px;
    background: white url(gradient.jpg) top left repeat-x;
    }
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  9. #9
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    To recap what thetestingsite is saying, make sure "gradient.jpg" is the correct path to your "gradient.jpg" image on your site. When in doubt, use an absolute URL, for example:

    Code:
    background: white url(http://www.mysite.com/gradient.jpg) top left repeat-x;

  10. #10
    Join Date
    Jan 2008
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yup I did all those things...made a gradient image using your tools, uploaded to my server, even used the full url to the gradient image I just uploaded but the background of the box was just white(blank).

    I will try to make a new gradient image again but I looked at my file (gradient.jpg) and it looks fine.

    I do have two scrollers on my page, maybe thats the prob? I only tried adding a gradient image for the first one.

    Will try it again soon...

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
  •