tags:

views:

897

answers:

3

Hi, Could someone explain to me what this portion of code means?

repeat scroll 0 0 #F6F6F6;

I have googled a lot and only found syntax to this part

-moz-linear-gradient(center top , #FFFFFF, #EFEFEF)

My code:

background: -moz-linear-gradient(center top , #FFFFFF, #EFEFEF) repeat scroll 0 0 #F6F6F6;

Thanks!

+2  A: 

These are actually part of the background CSS property, not -moz-linear-gradient. Have a look at that link, it should explain.

Basically:

  • repeat: The background repeats!
  • scroll: When the page scrolls, the background scrolls too
  • 0 0: Says, "start the background from this point in the image".

All the extra stuff is probably unneccessary - they seem to be the same as the defaults.

Lucas Jones
Oh, that makes sense now. Thanks!
bah
No problem. I find the combined CSS properties (`background`, `border`, etc.) confusing myself - I prefer to use `background-image`, `background-repeat`, etc. separately.
Lucas Jones
A: 

background: <image> <repetition> [scroll] <pos-x> <pos-y> <color>;

  • image can be both an image url() or in some browsers, a gradient object.
  • repetition can be no-repeat, repeat-x, repeat-y or repeat (both) and means how to repeat the image if it doesn't fill the background.
  • if scroll is set, the background will stay fixed on the screen and not follow the text when you scroll.
  • pos-x and pos-y determines the offset of the background.
  • color means the color that used if the image value was invalid.
Tor Valamo
A: 

Those are additional options to the background: css shorthand.

The repeat repeats the image (although, -moz-linear-gradient doesn't support repeating).

scroll (as opposed to fixed) allows the background to "scroll"

0 0 are x and y coords for the placement of the top left corner of the image.

#F6F6F6 is a background color

Jud Stephenson