Welcome Guest, Not a member yet? Register   Sign In
ci how to load the css file in the view?
#1

[eluser]shinianyijian[/eluser]
ci how to load the css file in the view?
My css folder in the root directory
#2

[eluser]umefarooq[/eluser]
you can load css or js file in view like this

Code:
With CI 2.1.+
//css file
<link href="<? echo base_url('css_dir_path/css_file.css')?>" rel="stylesheet" />

//js file
<scrip+ src="&lt;? echo base_url('js_dir_path/js_file.js');?&gt;"> </scrip+>

or

Code:
With CI 2.1. less then
//css file
&lt;link href="&lt;? echo base_url()?&gt;css_dir_path/css_file.css" rel="stylesheet" /&gt;

//js file
<scrip+ src="&lt;? echo base_url();?&gt;js_dir_path/js_file.js"> </scrip+>
#3

[eluser]shinianyijian[/eluser]
Thank you very much, I use the version is 2.1.2, I tried two methods are useful, do in a future version, only the &lt;link href = "&lt;? Echo off of the base_url ()? Css_dir_path / css_file.css "rel =" stylesheet "/&gt; can be used?
#4

[eluser]umefarooq[/eluser]
yes both method will work in future versions
#5

[eluser]shinianyijian[/eluser]
Well, I understand,thanks




Theme © iAndrew 2016 - Forum software by © MyBB