[英]why my style sheets are loaded for all other pages except one page, i get 404 for stylesheet files on that page
I hope you all are doing great, I ran into this wild issue, I'm making my front end in react, and I have several pages in my app, css for all the pages is defined in only one file and I'm loading it from the main HTML document(not react components). 希望大家都做得很好,遇到了这个大问题,我正在尽我所能,并且我的应用程序中有多个页面,所有页面的css仅在一个文件中定义,我正在加载它来自主HTML文档(不是React组件)。 CSS for all the pages is loaded but not for one particular page, the link of that page is sent via email through sendgrid, when I browse the page I get 404 for stylesheet and bootstrap files.
加载了所有页面的CSS,但没有加载特定页面的CSS,该页面的链接是通过sendgrid通过电子邮件发送的,当我浏览该页面时,我会收到404的样式表和引导文件。
This is how I'm loading style sheet from HTML document which hosts the root component of reacting. 这就是我从承载响应根组件的HTML文档中加载样式表的方式。
<html>
<head>
<link rel="stylesheet" href="app/assets/css/font-awesome.min.css">
<link rel="stylesheet" href="app/assets/css/bootstrap.min.css">
<link rel="stylesheet" href="app/assets/css/style.css">
</head>
<body>
<div id="app-root"></div>
<script src="/app/bundle.js"></script>
</body>
</html>
following are the screenshots of the network statistics for the pages which are loaded with css. 以下是随CSS加载的页面的网络统计信息的屏幕截图。
page failed to load with CSS with the same link to CSS files as the that of the prior one. 页面无法加载CSS,并且指向CSS文件的链接与上一个相同。
what seems to be the problem here, thank you, everybody, for taking out time and reading out this. 似乎是这里的问题,谢谢大家,感谢您抽出宝贵的时间来阅读这些内容。
Try doing this 试试这个
<link rel="stylesheet" href="/app/assets/css/font-awesome.min.css">
<link rel="stylesheet" href="/app/assets/css/bootstrap.min.css">
<link rel="stylesheet" href="/app/assets/css/style.css">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.