gpt4 book ai didi

html - 我怎样才能阻止我的 div 滚动?

转载 作者:行者123 更新时间:2023-11-28 16:56:53 24 4
gpt4 key购买 nike

我有一个响应式 div,它有 6 个选项(5 个文本 block 和 1 个按钮)。当此 div 达到手机屏幕大小时,div 会获得轻微的 15px 滚动。我使用了很多 absoluterelative 定位,我相信这可能是我的问题,但我还是想不通。

我试过使用 overflowoverflow-y 的一堆组合,但无法得到它。

HTML:

<div class="about-preface">
<div class="preface-container">
<div class="preface-block">
<h4><i class="fa fa-user-plus"></i> Donor Acquisition</h4>
<p>Startup nonprofits and established organizations need to consistently add new donors in order to surpass fundraising goals.</p>
<p><a href="/about-fundraising-400#a">More on Donor Acquisition</a></p>
</div>
<!-- 5 more of these divs -->
</div>
</div>

Here is a JS Fiddle里面还有所有东西。

最佳答案

您可能希望将 overflow: hidden 放在主体上以强制它包含您在 .about-preface 上的填充。

Demo

关于html - 我怎样才能阻止我的 div 滚动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31943891/

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