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.

CSS - Background image - Repeat X, Repeat Y

Discussion in 'CSS' started by bluemanteam, Dec 11, 2007.

  1. #1
    I have a 20x20px background image that I want to repeat to fill the entire screen.

    I have tried using the following:

    background: #000000 url(images/bg.gif) repeat-x repeat-y;

    This does not work, it only repeats on the X axis.

    Could someone please advise what is the correct syntax that I should be using.

    Thank you
     
    bluemanteam, Dec 11, 2007 IP
  2. EIx

    EIx Peon

    Messages:
    170
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    background: #000000 url(images/bg.gif) repeat;
     
    EIx, Dec 11, 2007 IP
  3. soulscratch

    soulscratch Well-Known Member

    Messages:
    962
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    105
    #3
    The default value repeats horizontally and vertically. If this still doesn't work, there's something else wrong with your page (or image).
     
    soulscratch, Dec 11, 2007 IP
  4. muthukswamy

    muthukswamy Peon

    Messages:
    676
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
  5. bluemanteam

    bluemanteam Peon

    Messages:
    169
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thank you, using just repeat without the X or Y worked.
     
    bluemanteam, Dec 11, 2007 IP
  6. Stomme poes

    Stomme poes Peon

    Messages:
    3,197
    Likes Received:
    135
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Because when you stated repeat-x repeat-y, the browser took the first thing it saw and figured you were using them to exclude other repeats (which is what they do). Repeat-x excludes repeat-y etc. So the two were conflicting.
     
    Stomme poes, Dec 12, 2007 IP
  7. magiclouie

    magiclouie Active Member

    Messages:
    147
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #7
    Yes, by default, it will repeat both horizontally and vertically. or the x and y
     
    magiclouie, Jan 26, 2012 IP
  8. snaker190

    snaker190 Greenhorn

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #8
    snaker190, Oct 17, 2012 IP
  9. AimeeJohnson

    AimeeJohnson Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #9
    background: #000000 url(images/bg.gif) top let repeat;

    you may remove the color tag if you wish if you want to display only image on your bg
     
    AimeeJohnson, Sep 15, 2013 IP
  10. deathshadow

    deathshadow Prominent Member

    Messages:
    6,675
    Likes Received:
    992
    Best Answers:
    167
    Trophy Points:
    395
    #10
    Which is a really BAD idea, since the color SHOULD be there for if images are disabled. One of those little accessibility bits people don't seem to think of anymore. Progressive enhancement, graceful degradation, and all that...
     
    deathshadow, Sep 16, 2013 IP
    HDaddy likes this.