使用 base_url()
编写的所有内容都不会加载到 Codeigniter 中。
<link href="<?php echo base_url(); ?>other/css/admin/style.css" rel="stylesheet" type="text/css">
<img class="brand" src="<?php echo base_url(); ?>other/img/logo.png">
存在于:
wamp -> www -> other -> css/img
我的 base_url 是:
$base_url = 'http://localhost/';
最佳答案
将您的基本 url 更改为此:
$base_url = 'http://localhost/PROJECTNAME/';
此处“PROJECTNAME”是您的元素目录。
关于php - CSS 和图片未在 Codeigniter 中加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42374829/