Jquery ScrollMagic和整页背景
我需要能够添加梯度和拉伸整个页面。但是,由于某些原因,渐变会在每个截面上不断重复。我尝试过使用Jquery ScrollMagic和整页背景,jquery,html,css,scrollmagic,Jquery,Html,Css,Scrollmagic,我需要能够添加梯度和拉伸整个页面。但是,由于某些原因,渐变会在每个截面上不断重复。我尝试过使用min height:100%,删除height:100%,添加height:auto;在包装器或正文中添加渐变,而不是html。然而,做这些事情给我带来了容器和身体的布局。最好的解决办法是什么我需要保持高度:100% html { color: #222; font-size: 1em; line-height: 1.4; height: 100
min height:100%
,删除height:100%
,添加height:auto
;在包装器或正文中添加渐变,而不是html
。然而,做这些事情给我带来了容器和身体的布局。最好的解决办法是什么我需要保持高度:100%
html {
color: #222;
font-size: 1em;
line-height: 1.4;
height: 100%;
background: linear-gradient(tomato, crimson);
background-repeat: no-repeat;
//background-size: cover;
//background-size: auto, cover;
//background-position: top left, center;
//b
}
将html css更改为:
html {
color: #222;
font-size: 1em;
line-height: 1.4;
background: linear-gradient(tomato, crimson);
}
这将删除高度并使其自动工作到页面大小。然后渐变将自动混合。将html css更改为:
html {
color: #222;
font-size: 1em;
line-height: 1.4;
background: linear-gradient(tomato, crimson);
}
这将删除高度并使其自动工作到页面大小。然后渐变将自动混合。将整个代码包装到一个包装器中,就像我在代码笔中所做的那样,包装器具有类
页面包装器
,并将渐变
分配给该类
在这里,我对您的
将整个代码包装到包装器中,就像我在代码笔中所做的那样,包装器具有类
页面包装器
,并将渐变
分配给该类
在这里,我对您的
将Css更改为此,可以保持高度:100%
html {
color: #222;
font-size: 1em;
line-height: 1.4;
height:100%;
}
html, body {
//height: 100%;
margin: 0;
background: linear-gradient(tomato, crimson);
}
将Css更改为此,您可以保持高度:100%
html {
color: #222;
font-size: 1em;
line-height: 1.4;
height:100%;
}
html, body {
//height: 100%;
margin: 0;
background: linear-gradient(tomato, crimson);
}
它仍然不起作用:(这是一个更好的例子。@IYU维吾尔,但在你更好的例子中,渐变在每个部分中不断重复。它仍然不起作用:(这是一个更好的例子)。@IYU维吾尔,但在你更好的例子中,渐变在每个部分中不断重复。