CodeIgniter Forums
How do you reference the bootstrap css and js in CI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: How do you reference the bootstrap css and js in CI (/showthread.php?tid=59500)



How do you reference the bootstrap css and js in CI - El Forum - 10-12-2013

[eluser]huangxiao[/eluser]
HI, I just want to ask some help how can i reference my CSS and JS bootstrap in CI.

I do it like this.


Code:
<!Doctype html>
  &lt;html&gt;
   &lt;head&gt;
       &lt;meta name="viewport" c initial-scale=1.0"&gt;
       &lt;!-- Bootstrap --&gt;
       &lt;link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen"&gt;
       &lt;link href="bootstrap/css/bootstrap-responsive.css" rel="stylesheet" media="screen"&gt;

       [removed][removed]
       [removed][removed]
   &lt;/head&gt;

&lt;body&gt;

  
       <div class="navbar navbar-fixed-top">
         <div class="navbar-inner">
              text
         </div>
       </div>


&lt;/body&gt;



&lt;/html&gt;


but it could not be found.can anyone would like to help how to use refrence the CSS and JS of bootstrap.

Thank you.


How do you reference the bootstrap css and js in CI - El Forum - 10-12-2013

[eluser]CroNiX[/eluser]
Don't use relative URLs.

Your url assumes the bootstrap directory will be in the same directory that the call was made to. If your bootstrap dir is in your web root dir, then you just need to add a / at the beginning of the url to tell it to start from the root of the site (/bootstrap/css/bootstrap.min.css), or use a complete url like http://yoursite.com/bootstrap/css/bootstrap.min.css



How do you reference the bootstrap css and js in CI - El Forum - 10-12-2013

[eluser]huangxiao[/eluser]
[quote author="CroNiX" date="1381611956"]Don't use relative URLs.

Your url assumes the bootstrap directory will be in the same directory that the call was made to. If your bootstrap dir is in your web root dir, then you just need to add a / at the beginning of the url to tell it to start from the root of the site (/bootstrap/css/bootstrap.min.css), or use a complete url like http://yoursite.com/bootstrap/css/bootstrap.min.css
[/quote]


Thank you so much you solved my problem.