title: How to link assets(images,stylesheet etc) in Views for CodeIgniter 2.1?
body: <p>I am using CodeIgniter <em>Version 2.1</em> &amp; trying to link assets like images,stylesheets, javascript files etc in my views by using, <code>header.php</code>:</p>
  
  <p><code>&lt;link href="&lt;?php base_url();?&gt;css/style.css" rel="stylesheet" /&gt;</code></p>
  
  <p>my controller code, calls the view:</p>
  
  <pre><code>&lt;?php
  class Main extends CI_Controller{
      public function index() {
          $this-&gt;load-&gt;view('header');
  }
  </code></pre>
  
  <ul>
  <li>The view file from which I am trying to load the asset is located
  <code>../application/views/header.php</code>. </li>
  <li>the css file is loaded:
  <code>../application/views/css/style.css</code></li>
  </ul>
  
  <p>this does not work. I get <strong>404 - Page not found</strong> error.then, I tried moving <code>css/style.css</code> outside <code>../application</code> directory in webroot.  To my surpise, having assets in webroot(outsite ../application/views) seems to work nicely.</p>
  
  <p>Now,
  My Question is</p>
  
  <ol>
  <li>Is having our assets directly in webroot, outsite <code>../application</code> directory right approach? If YES/NO, then why?</li>
  <li>If having assets directly in webroot is a good idea, than should I move <code>../application/views</code> directory in webroot as well? How?</li>
  </ol>
  
  <p><strong>PS:</strong> I am new to CodeIgniter framework, so unaware of the best practices</p>