1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Use background with css?

Discussion in 'CSS' started by fryman, Jan 22, 2005.

  1. #1
    I have this:

    .content {
    background-color: #FBFBFB;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: xx-small;
    color: #6507BD;
    }

    Instead of a color, I want to use a picture as my background, what do I need to change?

    Thanks
     
    fryman, Jan 22, 2005 IP
  2. fryman

    fryman Kiss my rep

    Messages:
    9,604
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    370
    #2
    Never mind, figured it out :)
     
    fryman, Jan 22, 2005 IP
  3. pinkpanther

    pinkpanther Peon

    Messages:
    72
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Great, just about to post an answer.. ummm, is that a real cat?
     
    pinkpanther, Jan 22, 2005 IP
  4. Smyrl

    Smyrl Tomato Republic Staff

    Messages:
    13,740
    Likes Received:
    1,702
    Best Answers:
    78
    Trophy Points:
    510
    #4
    How about posting, Fryman. I do not know the answer to your question.

    Shannon

    -----

    Thanks, David.
     
    Smyrl, Jan 22, 2005 IP
  5. david_sakh

    david_sakh Peon

    Messages:
    1,225
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #5
    
    background-image: url(backgroundimage.ext);
    
    Code (markup):
     
    david_sakh, Jan 22, 2005 IP
  6. fryman

    fryman Kiss my rep

    Messages:
    9,604
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    370
    #6
    Exactly

    Now it looks like this:

    .content {
    background-image: url(http://www.mydomain.com/images/back.jpg);
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: xx-small;
    color: #6507BD;
    }

    :)
     
    fryman, Jan 22, 2005 IP
  7. relaxzoolander

    relaxzoolander Peon

    Messages:
    141
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #7
    you also might want to control the repeat of the background.
    the default is for the background to repeat in both directions. [tiled]
    other options are:
    {
    background-repeat: repeat-x;
    background-repeat: repeat-y;
    background-repeat: no-repeat; [one instance]
    background-repeat: repeat; [tiled]
    }

    :)
     
    relaxzoolander, Jan 27, 2005 IP
  8. nevetS

    nevetS Evolving Dragon

    Messages:
    2,544
    Likes Received:
    211
    Best Answers:
    0
    Trophy Points:
    135
    #8
    and...
    You can set background for divs not just the body.
     
    nevetS, Jan 27, 2005 IP
  9. david_sakh

    david_sakh Peon

    Messages:
    1,225
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #9
    and table cells as well
     
    david_sakh, Jan 27, 2005 IP
  10. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Guys, background works for any element.

    J.D.
     
    J.D., Jan 27, 2005 IP
  11. david_sakh

    david_sakh Peon

    Messages:
    1,225
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #11
    not meta :p
     
    david_sakh, Jan 27, 2005 IP
  12. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Sure you can - try it in the CSS or HTML validator :)

    J.D.
     
    J.D., Jan 27, 2005 IP
  13. HHI Golf Guy

    HHI Golf Guy Guest

    Messages:
    86
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #13
    You can do some neat things with backgrounds. Take a look at the FSBO real estate site in my signature with your resolution at 800x600, then at 1024x768.

    It's a great way to fill what can be whitespace on higher resolutions. I've seen some sites set their container to align left, then have a vertical logo showing on the right hand side only when viewing at higher resolutions than 800x600.
     
    HHI Golf Guy, Jan 31, 2005 IP
  14. SEbasic

    SEbasic Peon

    Messages:
    6,317
    Likes Received:
    318
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Yeah... I played with trying to fill a little white space on seo-dev.co.uk

    I've got a couple of issues with some sites I'm working on at the moment but I'll get over them soon enough....

    I love playing with CSS.
     
    SEbasic, Jan 31, 2005 IP
  15. andthenwhat

    andthenwhat Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Playing with links is fun, and there's forgetting to include the stylesheet for a couple hours and wonder why it's not working... But you end up learning so much more like that, because it makes you use your brain to think of ways around things that should work that don't...

    and im not saying it should worked in my case... well, i'm just sayin!!
     
    andthenwhat, Aug 16, 2010 IP