Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why the width of the HTML tag is smaller when served with a local server?

I have an empty (boilerplate html) index.html file with the following style:

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

If I serve the file from a server or open it directly from the hard drive, the width for the html tag is correct.

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

somedomain.com/index.html

width is 1280px

If I start an Apache server or a Python server and visit the containing folder

localhost/foobar1

width is 1163.636px

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

Chrome Version 42.0.2311.135 (64-bit) running in Ubuntu 14.04.2

This does not happen in Firefox. Is this a bug or am I missing a config of some kind?

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

So far I have:

  • cleared all browser data
  • disabled all the extensions

no dice

like image 374
givanse Avatar asked Nov 26 '25 16:11

givanse


1 Answers

I could not find a culprit, ended up doing:

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

And reinstall.

like image 104
givanse Avatar answered Nov 29 '25 11:11

givanse



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!