简体   繁体   中英

Laravel-developed website looks different on localhost than on webhost despite the exact same files

Straight to the point.

I've created a website on Laravel framework, uploaded it to a server and for some reason - this is how it looks on my phone when tested ON the server and ON the local host accessed via (192.168.1.2)

Web host

虚拟主机

Local host

本地主机

Both server and localhost have identical files, the only difference is lack of garbage graphical files in the storage.

It seems that some CSS files can be loaded in one case and not on the other. Things to consider:

  • Are there hardcoded URLs for your CSS files (pointing to eg 192.168.1.2)?
  • Try opening the developer tools for the browser you're using on your phone. Then in the network tab, look for 404 errors.

I know this sounds like a dummy answer...

I was only editting the CSS file for past 3-4 hours so I thought to myself 'I only have to upload the css file', but I forgot that in the very beginning I've added

<meta name="viewport" content="width=device-width, initial-scale=1.0">

To the main template file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM