gpt4 book ai didi

css - 为什么我的样式没有加载到 HEAD - Angular

转载 作者:太空宇宙 更新时间:2023-11-04 06:51:39 25 4
gpt4 key购买 nike

这使我的网页加载时没有样式,在 js 加载样式之前会停留几秒钟。

Styles.js is loaded here and not in header

我在 angular.json 文件中添加了我的 css
“风格”:
[
“./node_modules/bootstrap/dist/css/bootstrap.min.css”,
“src/styles.sass”
],
“脚本”:
[
“./node_modules/jquery/dist/jquery.min.js”,
“./node_modules/bootstrap/dist/js/bootstrap.min.js”
]
它不应该在那里吗?

最佳答案

您的样式位于文档末尾。加载文档中的所有 Assets 后,浏览器将加载您的样式。浏览器在没有任何 CSS 的情况下呈现您的 HTML 代码,因为它还没有样式。

将样式包含移动到 <head> ,这样,样式将首先加载。

关于css - 为什么我的样式没有加载到 HEAD - Angular,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52814119/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com