简体   繁体   English

-moz线性梯度

[英]-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 我在Google上搜索了很多,只发现了这部分的语法

-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 . 这些实际上是background CSS属性的一部分 ,而不是-moz-linear-gradient Have a look at that link, it should explain. 看看那个链接,它应该解释。

Basically: 基本上:

  • repeat : The background repeats! repeat :背景重复!
  • scroll : When the page scrolls, the background scrolls too scroll :页面滚动时,背景也会滚动
  • 0 0 : Says, "start the background from this point in the image". 0 0 :说,“从图像的这一点开始背景”。

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. image可以是图像url(),也可以是某些浏览器中的渐变对象。
  • 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. 重复可以是“不重复”,“重复x”,“重复y”或“重复”(两者),并且表示如果图像不填充背景,如何重复图像。
  • 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. pos-x和pos-y确定背景的偏移量。
  • color means the color that used if the image value was invalid. color表示图像值无效时使用的颜色。

Those are additional options to the background: css shorthand. 这些是background:其他选项background: css速记。

The repeat repeats the image (although, -moz-linear-gradient doesn't support repeating). repeat重复图像(尽管-moz-linear-gradient不支持重复)。

scroll (as opposed to fixed ) allows the background to "scroll" scroll (与fixed相对)可让背景“滚动”

0 0 are x and y coords for the placement of the top left corner of the image. 0 0是图像左上角的x和y坐标。

#F6F6F6 is a background color

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM