我想在我的 index.html 文件中链接我的 css 文件。我的元素结构是:
MyWeb
Views
-> index.html
css
-> style.css
js
->jQuery.js
我尝试了以下相对 href 链接,但没有任何效果。
<link href="../css/style.css" rel="stylesheet">
<link href="./css/style.css" rel="stylesheet">
<script src="../js/jQuery.js"></script>
这是本地托管网站的链接:http://127.0.0.1:5000/
最佳答案
尝试 <link href="/css/style.css" rel="stylesheet">
相对于根
关于javascript - 链接到 index.html 中的 Css 和 js 文件时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29534983/