在xampp中的localhost上运行文件不包括引导程序文件

时间:2015-09-23 17:46:58

标签: php css twitter-bootstrap css3 xampp

所以我正在做一个使用bootstrap的项目。我的文件在htdoc> DocumentRepository

<link rel ="stylesheet" href ="C:\xampp\htdocs\DocumentRepository\Bootstrap\bootstrap-3.3.5-dist\css\bootstrap.min.css">
	<link rel ="stylesheet" href ="C:\xampp\htdocs\DocumentRepository\Bootstrap\bootstrap-3.3.5-dist\css\bootstrap-theme.min.css">

但问题是在localhost上运行它不包括任何bootstrap。 请帮帮我!

4 个答案:

答案 0 :(得分:0)

我想你的页面应该是这样的。

<link rel ="stylesheet" href ="css/bootstrap.min.css" type="text/css">
<link rel ="stylesheet" href ="css/bootstrap-theme.min.css" type="text/css">

将所有文件提取引导文件保存在CSS目录中。

您也可以使用CDN。

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

答案 1 :(得分:0)

无需使用或不需要包含来自根驱动器的文件,如链接。

href ="C:\xampp\htdocs\DocumentRepository\Bootstrap\bootstrap-3.3.5-dist\css\bootstrap.min.css"

首先在htdocs文件夹中创建一个主项目文件夹,如Bootstrap Directory style in Htdocs

然后您的文件夹位于Inside Project Folder

然后在 inde.html index.php 中 添加这些风格的链接

<link ytpe="text/css" rel="stylesheeet" href="css/bootstrap.min.css" />
<script type="text/javascript" src="js/bootstrap.min.js"></script>

如果其他事情是完美的,那么代码将完美运行。

答案 2 :(得分:0)

  

http://localhost/2017/bootstrap.min.css

如果您的引导程序或htdose文件夹中的任何css或jquery文件,那么您必须编写http://localhost/然后编写文件夹的名称,如果您在htdose内部,否则直接写入文件名称然后扩展

答案 3 :(得分:0)

在任何Linux系统中,当目录以“ /”开头时,则为引导文件的位置。 因此,只需添加src =“ path / file”之类的文件,即可使用