html - 为什么使用本地服务器时 HTML 标记的宽度更小?

标签 html css google-chrome

我有一个空的(样板 html)index.html 文件,其样式如下:

html {
  width: 100%;
  overflow: hidden;
}

如果我从服务器提供文件或直接从硬盘打开它,html 标签的宽度是正确的。

file:///var/www/html/foobar1/index.html

somedomain.com/index.html

宽度为1280px

如果我启动 Apache 服务器或 Python 服务器并访问包含的文件夹

localhost/foobar1

宽度为1163.636px

document.getElementsByTagName('html')[0].clientWidth
1163
document.getElementsByTagName('html')[0].offsetWidth
1164

Chrome 版本 42.0.2311.135(64 位) 在 Ubuntu 14.04.2 中运行

这在 Firefox 中不会发生。这是错误还是我缺少某种配置?

index.html:https://gist.github.com/givanse/ed850a0983d53c766d2f

到目前为止我有:

  • 清除所有浏览器数据
  • 禁用所有扩展

没有骰子

最佳答案

我找不到罪魁祸首,最后做了:

sudo apt-get remove google-chrome
rm -r ~/.config/google-chrome/

然后重新安装。

关于html - 为什么使用本地服务器时 HTML 标记的宽度更小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30113516/

相关文章:

css - "system-ui"Chrome 中的 CSS 字体系列无法识别 macOS 上高于特定字体大小的字体粗细

android - 更改 WebRTC 浏览器调用中使用的密码

javascript - Chrome : Add to homescreen error: Site cannot be installed

html - 如何保持页脚向下

javascript - 在javascript中绘制后如何避免重复?

html - 带圆 Angular 的链接图像的交互区域

jquery - 使 DIV 和 UL 像 SELECT 元素一样

html - 将剩余宽度除以两个 div 并在相对推送时隐藏一个 div

html - WordPress 中的文本无法在 Chrome 中正确呈现

javascript - 轴-范围- slider 对齐