热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Chrome神奇地增加了3px到页脚宽度-Chromemysteriouslyadds3pxtofooterwidth

ThefooteratmysiteAtlanticSentinelhasawidthspecifiedat960pxandamax-widthalsoat960px

The footer at my site Atlantic Sentinel has a width specified at 960px and a max-width also at 960px. It looks fine in IE but Chrome adds 3px to the width. Why, I can't figure it out.

我的网站Atlantic Sentinel的页脚宽度指定为960px,最大宽度也为960px。它在IE中看起来不错,但Chrome增加了3px的宽度。为什么,我无法弄明白。

Here's the relevant CSS:

这是相关的CSS:

#colophon {
clear: both;
display: table;
width: 960px;
max-width: 960px;
background: #131313;
overflow: hidden;
border-top: 3px solid #0099cc;}

#colophon .widget {
display: table-cell;
float: left;
width: 22%;
margin: 2em 0 2em 2em;
background: #000;
color: #ccc;
text-align: justify;}

It's not the margins on the widgets. I've tried removing one, so there's only three widgets, 22% wide, and the extra 3px is still there in Chrome.

这不是小部件的边缘。我已经尝试删除一个,因此只有三个小部件,22%宽,而额外的3px仍然存在于Chrome中。

What am I missing?

我错过了什么?

3 个解决方案

#1


-1  

This seems to be a bug in webkit, to fix it just set your footer to explicitly collapse the borders you added to the top of your footer like so:

这似乎是webkit中的一个错误,修复它只是设置你的页脚明确地折叠你添加到页脚顶部的边框,如下所示:

#colophon {
 border-collapse: collapse;
}

Make sure to remove the overflow:hidden declaration as it is not needed anymore.

确保删除溢出:隐藏声明,因为它不再需要。

EDIT. Yup, a bug. Managed to recreate it here, http://jsfiddle.net/PnYPr/ . Same problem as OP's in webkit. Will submit a bug report.

编辑。是的,一个bug。管理在这里重新创建它,http://jsfiddle.net/PnYPr/。与webkit中的OP相同的问题。将提交错误报告。

EDIT 2. Bug reported.

编辑2.报告错误。

#2


0  

Remove the display: table; rule. It's unnecessary, and you don't need to change it to anything else like display: block since that's the default and you're not overriding that in your example.

删除display:table;规则。这是不必要的,你不需要将它改为其他任何东西,比如display:block,因为那是默认值,你不会在你的例子中覆盖它。

#3


0  

try display:inline; code instead of display: table-cell; and then see if you have achieved???

尝试显示:内联;代码而不是display:table-cell;然后看看你是否已经实现了???


推荐阅读
author-avatar
欣荣_75229
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有