我正在为网页创建CSS样式表。我想要整个网页的渐变背景,但是我不知道如何获得渐变来覆盖整个网页。目前,渐变采用的是典型横幅广告的形式,该横幅广告通过网站向下复制,就像另一个顶部的“条”一样。
关于如何解决这个问题的任何想法?
我到目前为止的代码:
body {
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #FBFF94), color-stop(1, #00A3EF));
}
较早的两个答案的结合应该工作:
body {
min-height: 100vh;
background: -webkit-linear-gradient(to left bottom, #FBFF94, #00A3EF);
background: linear-gradient(to left bottom, #FBFF94, #00A3EF);
}
或者:
body {
height: 100vh;
background: -webkit-linear-gradient(to left bottom, #FBFF94, #00A3EF);
background: linear-gradient(to left bottom, #FBFF94, #00A3EF);
background-attachment: fixed;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句