我有一个空的(样板 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/