gpt4 book ai didi

css - 设置为 100% 高度的背景仍然重复

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

我有以下 CSS 代码。

body{
height: 100%;
min-height: 100%;
max-height: 100%;
background-color: #1468b3;
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#2F2727), to(#1468b3));
background-image: -webkit-linear-gradient(top, #2F2727, #1468b3);
background-image: -moz-linear-gradient(top, #2F2727, #1468b3);
background-image: -ms-linear-gradient(top, #2F2727, #1468b3);
background-image: -o-linear-gradient(top, #2F2727, #1468b3);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#2F2727", endColorstr="#1468b3");
}

无论页面内容如何,​​都应该有一个从浏览器窗口顶部延伸到底部的漂亮渐变。这个截图说明了这个问题:

enter image description here

我不太清楚为什么会这样。

添加

no-repeat;

取消渐变,取而代之的是纯色背景 #1468b3

最佳答案

尝试添加 html { height: 100%; }

关于css - 设置为 100% 高度的背景仍然重复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13260401/

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