gpt4 book ai didi

css - CSS 中带有渐变背景的不需要的重复

转载 作者:行者123 更新时间:2023-11-28 12:12:09 26 4
gpt4 key购买 nike

我正在为网页创建 CSS 样式表。我想要整个网页的渐变背景,但我不知道如何让渐变覆盖整个网页。现在,渐变采用典型横幅的形式,通过网站向下复制,就像一个“条”在另一个之上。

关于如何解决这个问题有什么想法吗?

我目前的代码:

body {
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #FBFF94), color-stop(1, #00A3EF));
}

最佳答案

使用 VH 单位,即垂直高度。

考虑

100vh = 100%.

body {

background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #FBFF94), color-stop(1, #00A3EF));

height:100vh; /* vh = Vertical Height */
}

Example Here

关于css - CSS 中带有渐变背景的不需要的重复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29358781/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com