【发布时间】:2013-07-30 09:29:26
【问题描述】:
所以今天我开始使用 code-igniter,但遇到了一个问题。 问题是我想将一个 css 文件链接到我的默认视图。我的尝试是将我的 css 文件放在 root 的根目录中。所以它看起来像这样
-Root
--application
--system
--styles
----main.css
--index.php
然后在我看来,我通过假装它在同一个文件夹中来链接我的 css 文件,如下所示:
<link href="styles/main.css" rel="stylesheet" type="text/css">
现在当我像这样访问我的默认控制器时:http://localhost/index.php 它可以工作!!
但是当我像这样http://localhost/index.php/home/index 访问它时,它不起作用。它尝试使用此路径http://localhost/index.php/styles/main.css访问css文件
我该如何解决这个问题,或者,正确的方法是什么?
【问题讨论】: