开发者

-moz-linear-gradient

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!


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.


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜