When You Repeat a Background Image, Is Specifying Position Necessary?

Discussion in 'CSS' started by Masterful, Jul 5, 2010.

  1. #1
    I'm a little confused about something.

    When you repeat an image horizontally or vertically, is it necessary to specify the image's starting position? In other words, is this sufficient:

    #main_div {
    background: #fff url('image.jpg') repeat-y;
    }
    Code (markup):
    Or must I include the starting position of the image, thus:

    #main_div {
    background: #fff url('image.jpg') repeat-y center top;
    }
    Code (markup):
     
    Masterful, Jul 5, 2010 IP
  2. Asgeco

    Asgeco Member

    Messages:
    32
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #2
    I have coded a lot of designs and there wasn't a case then I needed to do this so I think it isn't necessary to specify starting position.
     
    Asgeco, Jul 6, 2010 IP
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #3
    When in doubt, RTFM. ;)

    cheers,

    gary
     
    kk5st, Jul 6, 2010 IP
  4. Master_Seller

    Master_Seller Well-Known Member

    Messages:
    731
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    110
    #4
    No, Specifying the background position is not mandatory. It is optional. If nothing is mentioned. By default it is top left.
     
    Master_Seller, Jul 6, 2010 IP