这个问题已经被问过好几次了,但还没有找到适合我的元素的正确答案。
我喜欢的 CSS 文件
<link rel="stylesheet" type="text/css" href="assets/css/style.css"/>
css文件在:
-main_directory
-Application
-Assets
-css
-style.css
-System
我还尝试使用 base_url 链接 css href="<?php echo base_url('assets/css/style.css');?>"
但它对我不起作用。
那么问题是什么?谁能帮忙?
最佳答案
你的结构应该是这样的
myproject
application
assets
css
style.css
system
在 config/autoload.php
中自动加载 url 助手
$autoload['helper'] = array('url');
现在
<link href = '<?php echo base_url()?>/assets/css/style.css'>
这应该有效。确保您的拼写正确,如果您使用的是 linux,请查看 casd 敏感问题。
关于css - 样式 CSS 不使用 CodeIgniter - Baseurl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16118795/