界面显示不正确。

huangapple go评论65阅读模式
英文:

The interface is not displayed correctly

问题

下午/晚上好,我目前正在创建网站并决定测试其适应性。在计算机上一切正常:

界面显示不正确。
界面显示不正确。

但当我将它转移到手机上(Redmi Note 9 PRO 和 Samsung Galaxy J1),出现了以下情况:

界面显示不正确。

由于某种原因,手机浏览器无法看到导入的样式和 JS。我有一个问题:如果我将其放在托管上,会是同样的情况吗?为什么手机看不到样式?

如果您需要元标记和文件路径,那么这是它们:

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="format-detection" content="telephone=no">
    <link rel="shortcut icon" href="./img/favicon.svg" type="image/x-icon">
    <link rel="stylesheet" href="./css/bootstrap.min.css">
    <link rel="stylesheet" href="./css/icons/bootstrap-icons.css">
    <link rel="stylesheet" href="./css/style.css">

<!-- end snippet -->

我希望能得到为什么会发生这种情况的解释,提前感谢。

英文:

Good afternoon/evening, I am currently in the process of creating the website and decided to test its adaptability. Everything looks good on the computer:

界面显示不正确。
界面显示不正确。

But when I transferred it to the phone (Redmi Note 9 PRO and Samsung Galaxy J1), the following came out:

界面显示不正确。

For some reason, the phone browser does not see the imported styles and JS. I have a questions: if I put it on hosting, will it be the same stuff? And why doesn't the phone see the styles?

If you need meta tags and file paths, then here they are:

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
    &lt;meta name=&quot;format-detection&quot; content=&quot;telephone=no&quot;&gt;
    &lt;link rel=&quot;shortcut icon&quot; href=&quot;./img/favicon.svg&quot; type=&quot;image/x-icon&quot;&gt;
    &lt;link rel=&quot;stylesheet&quot; href=&quot;./css/bootstrap.min.css&quot;&gt;
    &lt;link rel=&quot;stylesheet&quot; href=&quot;./css/icons/bootstrap-icons.css&quot;&gt;
    &lt;link rel=&quot;stylesheet&quot; href=&quot;./css/style.css&quot;&gt;

<!-- end snippet -->

I hope to get an explanation of why this is happening, thank you in advance

答案1

得分: -1

我猜你正在直接打开你的文件,而你可能需要一个像这样的http服务器:https://www.npmjs.com/package/http-server

你可以让它监听0.0.0.0,然后你应该能够通过你的本地IP打开它。

英文:

I'm guessing you're opening your files directly, and that you might need a http server like this: https://www.npmjs.com/package/http-server

You can get it to listen to 0.0.0.0, and then you should be able to open it through your local IP.

huangapple
  • 本文由 发表于 2023年7月20日 20:09:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/76729695.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定