通过以下与 CSS/JS 的链接,我能够成功地选择除 Glyphicons 之外的所有 CSS。
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="../bootstrap-3.3.5-dist/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="../bootstrap-3.3.5-dist/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="../bootstrap-3.3.5-dist/bootstrap.min.js"></script>
元素文件夹结构:
-- bootstrap-3.3.5-dist
-- myProjectFolder -- index.html
-- aboutUs.html
-- ...html
-- ...html
我得到的是:
然而,在将 HTML 文件移动到根目录后,一切都完美无缺,因此我在元素根目录中拥有 HTML 和 Bootstrap 。链接更改为:
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="bootstrap-3.3.5-dist/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href=".bootstrap-3.3.5-dist/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
元素文件夹结构现在更改为:
-- bootstrap-3.3.5-dist
-- index.html
-- aboutUs.html
-- ...html
-- ...html
为什么会这样,有没有办法在不将 HTML 文件移动到根目录的情况下使它全部工作?
最佳答案
root path是您网站的顶级路径。它没有父文件夹。您可以转到 /
或 /index.hmtl
,但是,/../foo
。
document root将您网站的根路径映射到文件系统的目录。在您的文件系统上,文档根目录可能不是文件系统根目录,并且确实有一个父目录。
但是就网站而言,根之上没有任何东西。因此,不在文档根目录下的目录完全超出了网站的范围。
关于html - Bootstrap Glyphicons 不会显示,除非所有文件都在根目录中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33699869/