how can i include the css file in codeigniter

how can i include the css file in codeigniter  using -'php,html,css,codeigniter'

I have make a assets folder in root directory where application folder exist. now I have assets sibling to application.

Now when I tried to open http://localhost/CodeIgniter/assets/css/bootstrap.min.css in web-page it's not working.

Do someone can help me how I can got it worked.

In a solution I found that writing this line in config file will work but it's not work either by doing this change.

$config['base_url'] = 'http://localhost/CodeIgniter/';

Now please some guideline me how to load CSS file in CI.

solution :-

I have done something wrong in my codeigniter project. I download it again and try these thing again, without anything it's working.

thanks you all of guys. you save my time.

asked Sep 15, 2015 by DelGuertin
0 votes

2 Answers

0 votes

define general css that used. Open "config.php" within directory CodeIgniter\system\application\config.

$config['css'] = 'mystyles.css';

Create a file named mystyles.css within root application: \CodeIgniter.

$data['css']        = $this->config->item('css'); 

You can load css in views pages like this.

answered Sep 15, 2015 by AraRomano
0 votes

In constant.php:


In config.php:

$config['base_url'] = URL;

In view:

Hope that helps somewhat.

answered Sep 15, 2015 by Len7217