希望这是一个简单的过程。在 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;}
最佳答案
从 .first-sub-news
类中删除 overflow: auto;
CSS 属性。
如果您不希望它滚动,也可以在 .sub-news
类上。
注意:overflow: auto;
如果其中的内容大于定义的高度或宽度,将自动添加滚动条。
关于html - 滚动条出现在我的 html 页面上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19661593/