简体   繁体   English

如何在index.html中的资产文件夹内设置文件

[英]How to set files inside the assets folder in index.html

I have a folder structure like below 我有一个如下的文件夹结构

  • angular-src 角-SRC
    • src SRC
      • index.html 的index.html
  • bootstrap 引导
  • css CSS
  • app.js app.js

In my app.js file I have set this static folder like: 在我的app.js文件中,我将此静态文件夹设置为:

// Set Static Folder
app.use(express.static(path.join(__dirname, 'public')));

I want to set css and bootstrap files inside the index.html. 我想在index.html中设置css和bootstrap文件。

Here's index.html file: 这是index.html文件:

<!DOCTYPE html>
<html>
  <head>
    <title>Alpha Theme</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- jQuery UI -->
    <link href="https://code.jquery.com/ui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" media="screen">
    <!-- Bootstrap -->
    <link href="./bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <!-- styles -->
    <link href="./css/styles.css" rel="stylesheet">
    <link href="./css/stats.css" rel="stylesheet">
</head>
<body>
  <app-root>Loading...</app-root>
  <footer>
    <div class="container">
       <div class="copy text-center">
          Copyright 2014 <a href='#'>Website</a>
       </div>
    </div>
 </footer>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://code.jquery.com/jquery.js"></script>
<!-- jQuery UI -->
<script src="https://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="./bootstrap/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="./vendors/morris/morris.css">
<script src="./vendors/jquery.knob.js"></script>
<script src="./vendors/raphael-min.js"></script>
<script src="./vendors/morris/morris.min.js"></script>
<script src="./vendors/flot/jquery.flot.js"></script>
<script src="./vendors/flot/jquery.flot.categories.js"></script>
<script src="./vendors/flot/jquery.flot.pie.js"></script>
<script src="./vendors/flot/jquery.flot.time.js"></script>
<script src="./vendors/flot/jquery.flot.stack.js"></script>
<script src="./vendors/flot/jquery.flot.resize.js"></script>
<script src="./js/custom.js"></script>
<script src="./js/stats.js"></script>
</body>
</html>

For directory structure : 对于目录结构:

  • use single dot(.) for current directory 对当前目录使用单点(。)
  • use double dots(..) jump out the current directory 使用双点(..)跳出当前目录

Now coming to your question to set path of your css and bootstrap files use in index.html : 现在要问您的问题来设置在index.html中使用的css和bootstrap文件的路径:

<!-- Bootstrap -->
    <link href="../../bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- styles -->
    <link href="../../css/styles.css" rel="stylesheet">
    <link href="../../css/stats.css" rel="stylesheet">

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使 Vue 从 assets 文件夹中导入文件,而不是 index.html 内的硬编码脚本标签 - How to make Vue import files from assets folder instead of hardcoded script tags inside of index.html 如何指导网站主机访问文件夹内的`index.html` - how to direct website host to access `index.html` inside a folder 如何用绝对路径吞噬构建index.html参考资产? - How to gulp build index.html reference assets with absolute paths? CORS 错误。 无法从 index.html 访问父目录中的资产文件夹 - CORS Error. cannot access assets folder in parent directory from index.html 如何读取文件夹内的文件夹并从每个文件夹中获取 index.html 并作为列表 (li) 标签中的链接传递 - How to read the folders inside a folder and get the index.html from each folder and pass as a link in a list (li) tag 如何使用多语言/多个index.html文件正确设置React Router? - How to correctly set up React Router with multilanguage/multiple index.html files? Cordova app无法加载assets / www中的任何文件(仅限index.html) - Cordova app cannot load any files in assets/www (only index.html) 如何在 index.html 中加载另一个 html 点击 Javascript - How to load another html inside index.html on click Javascript Angular 5如何在index.html中检测到我们正在生产中 - Angular 5 How to detect that we are in production inside the index.html 如何删除index.html和karma中加载的脚本文件中的重复项? - How to remove duplication in the script files loaded in index.html and karma?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM