gpt4 book ai didi

html - 滚动条出现在我的 html 页面上

转载 作者:太空宇宙 更新时间:2023-11-04 13:54:07 25 4
gpt4 key购买 nike

希望这是一个简单的过程。在 chrome 中查看时,我的网页上出现了滚动条。我认为这是填充或边距问题,但我无法对其进行排序。有人可以看看吗?

我的CSS:

.sub-news {width: 750px; margin: 0 0 20px 0px; padding: 0 0 0 10px; clear: both; overflow: auto; }
.sub-news h3 {font-size: 1em; margin: 5px 0 0 0;}
.sub-news a {background-color: #f39200; padding: 5px; margin: 0 0 10px 0; color: #fff; text-decoration: none;}
.sub-news img {width: 220px; height: 127px;}
.sub-news p {width: 220px;}

.first-sub-news, .second-sub-news, .third-sub-news {width: 240px; float: left; overflow: auto;}

Fiddle.

最佳答案

.first-sub-news 类中删除 overflow: auto; CSS 属性。

如果您不希望它滚动,也可以在 .sub-news 类上。

注意:overflow: auto;如果其中的内容大于定义的高度或宽度,将自动添加滚动条。

关于html - 滚动条出现在我的 html 页面上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19661593/

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