gpt4 book ai didi

css - 背景图像不滚动?

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

我的背景图片没有上下滚动,或者向下滚动太多。我希望它向下滚动到背景图像的底部,然后停止。

<head>
<style type='text/css'>
.noWhiteSpace {
margin-left:0;
margin-right:0;
margin-top:0;
background-color:#F4F7E3;
background-image:url('/front_page.jpg');
background-repeat:no-repeat;
background-size:100%;
height:180%;
}
.words {
font-family:Madelinette;
text-align:center;
margin-left:25%;
margin-top:10%;
}
#lineOne {
color:#5f4e2b;
font-size:5em;
}
#lineTwo {
color:#629040;
font-size:4em;
padding-bottom:2%;
}
#otherLines {
color:#952221;
font-size:2em;
}
</style>
</head>
<body class='noWhiteSpace'>
<div class='words'>
<div id='lineOne'>Crafters &nbsp;Resale</div>
<div id='lineTwo'>blah</div>
<div id='otherLines'>blah<br>blah<br>blah<br>blah<br>blah</div>
</div>
</body>

最佳答案

background-attachment: scroll 是默认的,你不需要指定它。你的图像没有滚动,因为你的 body 没有足够的高度尝试在 css 中明确给出高度或者只是在你的 body 中添加更多内容。

希望这对您有所帮助,但如果您有不同的要求,请详细说明。

关于css - 背景图像不滚动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17626695/

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