一个express框架写的网站,一直用localhost测试是好的。但是通过ip访问就乱了。这是怎么造成的那?找到原因了:是浏览器放大造成的对于图如下:localhost访问:
ip访问:
It turned out to be caused by the browser’s magnified display
windows.location.hrefGet the current URL and then display different elements.
windows.location.href
It’s best if you can post the relevant code, such as the css and js references of this page, as well as the background code related to this
My personal feeling is that the css is not loaded. It is recommended that the server uses node to start the project, open the web page and then check whether the css is loaded on the server side
GET /stylesheets/style.css 200 216ms - 2.8kb
Are the browsers the same?
Is it resolved? It should be a cache issue.
It turned out to be caused by the browser’s magnified display
windows.location.href
Get the current URL and then display different elements.It’s best if you can post the relevant code, such as the css and js references of this page, as well as the background code related to this
My personal feeling is that the css is not loaded. It is recommended that the server uses node to start the project, open the web page and then check whether the css is loaded on the server side
Are the browsers the same?
Is it resolved? It should be a cache issue.