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

标签 html css scrollbar

希望这是一个简单的过程。在 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/

相关文章:

javascript - jQuery 附加到同级 div

javascript - 如何同时在多个 div 上运行一个函数?

javascript - 旋转功能

html - 如何在没有javascript的情况下使三个元素具有相同的高度?

javascript - 当我的响应式菜单打开时,如何删除用户转到两侧的功能?

html - 输入焦点时动画父 div

android - 悬停时导航栏间隙

linux - Eclipse GUI 中的滚动条不存在

delphi - 修复了与滚动条结合的 BorderWidth > 0 的错误?

html:有没有办法在html代码中包含滚动条