【发布时间】:2016-08-10 07:17:11
【问题描述】:
有没有办法让渐变背景的每个交替重复都反转?目前我有以下 CSS:
html {
background: white; /* For browsers that do not support gradients */
background: -webkit-linear-gradient(blue, white); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(blue, white); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(blue, white); /* For Firefox 3.6 to 15 */
background: linear-gradient(blue, white); /* Standard syntax */
background-size: cover;
height: 100%;
}
body {
height: 100%;
}
<html>
<head>
</head>
<body
Hello world
</body>
</html>
目前它从上到下从蓝色变为白色,但当我向下滚动时,它再次从蓝色重复到白色例如。 blue->white; blue->white; blue->... 。我希望它来自blue -> white -> blue -> white ->...。
【问题讨论】:
-
为什么不做类似背景的事情:线性渐变(蓝色,白色,蓝色);并从中调整?
-
这里有类似的东西。我知道您有这样的背景,并且在某些行动中,您想要相反的效果,不是吗? stackoverflow.com/questions/19318534/…
标签: html css repeat linear-gradients