【发布时间】:2012-10-01 13:14:17
【问题描述】:
我的 header.php 没有正确链接到 default.css。页面加载时未应用 CSS。 如果我查看页面的源并单击 .css 文件的链接 - 403 Forbidden 会显示在 Source View 中。
config.php
$config['base_url'] = 'http://localhost/dev/';
routes.php
$route['default_controller'] = "page/view";
$route['404_override'] = '';
pages 是控制器
视图 是方法
application/view/templates/header.php
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="<?php echo base_url(); ?>application/css/default.css" rel="stylesheet" type="text/css" />
<title><?php echo $title; ?></title>
</head>
<body>
application/css/default.css
* {margin:0;padding:0;}
body {
background-image: url(../images/bg.gif);
background-repeat: repeat-x;
...
}
应用程序/图像/
-- bg.gif GIF Image 1KB
【问题讨论】:
-
403 Forbidden -> 检查您的网络服务器的错误日志。它应该告诉你更多幕后发生了什么
-
使用
href="/application/css/default.css"
标签: php codeigniter