Graded Background

Discussion in 'HTML & Website Design' started by praetorian guardian, Feb 13, 2007.

  1. #1
    I really want to make the background of my site have a sort of Graded/light source effect.. It starts off almost white in the top corner but slowly turns to darker grey in the bottom right... im not completely sure how to achieve it..
    any ideas?

    im talking about the sort of thing shown here

    http://www.mozilla.org/

    or even better here

    http://www.webdesignfromscratch.com/
     
    praetorian guardian, Feb 13, 2007 IP
  2. ehlokoen

    ehlokoen Peon

    Messages:
    161
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Make a *height* by 2px picture and fill it with gradient (make sure it's a good line, else your layout will not look as good as it should)

    Then use the following code:
    <style>
    body
    {
      background-img: url("YOUR_FILE.YOUR_EXT");
      background-repeat: repeat-x;
    }
    HTML:
    This will set a background to your body tag and limit repeating the image only horizontal (see you want to get freaky repeats when you have a long page :)

    Hope this helped, good luck!
     
    ehlokoen, Feb 13, 2007 IP
  3. praetorian guardian

    praetorian guardian Guest

    Messages:
    270
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks i found this page and it was a great help

    http://www.dellwebsites.com/web/box/gradient.html

    I was actualy doing it right.. but Ive found that the tag for a background image has to be a full ("url") not just a shorthand "/images/" not sure why.. kind of annoying.. but not a big problem.
     
    praetorian guardian, Feb 13, 2007 IP
  4. rgchris

    rgchris Peon

    Messages:
    187
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can use relative links for background images. Or was that not what you were saying?
     
    rgchris, Feb 13, 2007 IP
  5. praetorian guardian

    praetorian guardian Guest

    Messages:
    270
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #5
    no.. i was saying you can't use relative links for a background image..

    im not sure why not.. but it doesnt seem to like it.
     
    praetorian guardian, Feb 13, 2007 IP
  6. MattD

    MattD Peon

    Messages:
    161
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You can use them - I use them all of the time. Try either removing the leading /, or adding in ".." or "." depending on your directory structure!
     
    MattD, Feb 13, 2007 IP