Home > Back-end >  It looks like Safari doesn't see css file
It looks like Safari doesn't see css file

Time:12-11

I'm making a site page. Everything is wonderful, I tested it on my iPhone with local server. Everything worked well, but when I uploaded it to my hosting, it works well on desktop, but when I open it on my iPhone 13, it looks terrible. It looks like html file isn't linked with css file.Site on local server Site on hosting(Safari)

I tried to change some css settings

CodePudding user response:

This is probably due to the way your files are served on your local server

When you are testing your site on your local server, the HTML and CSS files are served from the same origin and the browser can load them without any issues. However, when you upload your site to your server on your iPhone, the HTML and CSS files may be served from different origins and the browser may block the CSS file from loading.

Try this:

<link rel="stylesheet" href="styles.css" crossorigin="anonymous">
  • Related