【发布时间】:2017-08-13 23:31:15
【问题描述】:
我在 codeigniter 中有一个控制器,名称为 Home,代码如下所示:
class Home extends CI_Controller {
public function index() {
$this->load->view('foundation_css');
$this->load->view('topbar');
$this->load->view('home_page');
}
}
foundation_css 视图包含链接的基础 css,topbar 视图包含显示 topbar 的 html,home_page 视图构建基本主页。
当我访问的 url 是 http://localhost/codeigniter/index.php 时,页面是这样的。
当我访问的 url 是 http://localhost/codeigniter/index.php/home/ 时,页面是这样的。
为什么当 url 改变时 CSS 会消失?我访问 css 文件的 url 会改变吗?如果是这样,我将如何补救这种情况?欲了解更多信息,我使用的网址是<link rel="stylesheet" type="text/css" href="css/foundation.min.css">。文件树如下所示:
/
css/
-foundation.min.css
application/
controllers/
home.php
views/
foundation_css.php
topbar.php
home_page.php
【问题讨论】:
标签: php css codeigniter