[英]How to refer to css file in codeigniter? 2.0
What is the difference if I store the main.css file in /webroot/myapp/css
or /webroot/assets/css
?如果我将main.css文件存储在
/webroot/myapp/css
或/webroot/assets/css
什么区别?
This one is working...这个正在工作...
<link rel="stylesheet" href="/assets/css/main.css" type="text/css" />
This one does not...这个不...
<link rel="stylesheet" href="/myapp/css/main.css" type="text/css" />
Why?为什么?
加载 URL 助手,然后像这样添加到您的 href 中:
<link rel="stylesheet" href="<?php echo base_url() ?>/assets/css/main.css" type="text/css" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.