Codeigniter CSS problem

I have one controller called blog.php
as follows


<?php
class Blog extends Controller {
    function index()
    {
        $this->load->helper(array('form', 'url','security'));
        $this->load->library('form_validation');
        $data['header'] = 'header'; // name of the view
        $this->load->library('template');
        $this->load->view('template', $data);
    }
    function home()
    {
        $this->load->helper(array('form', 'url','security'));
        $this->load->library('form_validation');
        $data['header'] = 'header'; // name of the view
        $this->load->library('template');
        $this->load->view('template', $data);
        $this->load->view('home');    // name of the view
    }
    function forum()
    {
        $this->load->view('forum'); // name of the view
   }

http://localhost/blog is giving me the output what i want
but it seems that css file is not added for
http://localhost/blog/index
or http://localhost/blog/home

why it is so??
n what is the diffrance between
http://localhost/blog/ and http://localhost/blog/index

You actually didn’t provide the main thing, what is the direct URL to your css file :).

Either way I believe I know what your problem is.

Open the .htaccess file in the root of your CodeIgniter folder. And paste the codes below:

RewriteEngine on
RewriteCond $1 !^(index\\.php|javascript|css|images|robots\\.txt)
RewriteRule ^(.*)$ ./index.php/$1 [L]

If the CSS file resides in a different folder (e.g. http://local/blog/css/style.css) Make sure the folder name is listed under RewriteCond, else CI will treat it like a controller.

In the template folder import the CSS file like below:

<style src="<?php echo base_url(); ?>css/style.css" type="text/css" />

Cheers!