![]() |
Bootstrap.css not working - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Bootstrap.css not working (/showthread.php?tid=71593) |
Bootstrap.css not working - fresh96 - 09-02-2018 I am new to CodeIgniter, and currently practicing it because we have to use this framework for a huge project. Right now I'm creating a sample project with bootstrap. It doesn't work when I download bootstrap, put it in a folder with the same level as application and system folders. But if I use bootstrap's CDN, it actually works but I don't want to do that because in our major project we will be using a custom bootstrap template which does not have a CDN link. At first, I thought it was the base_url, but it works when I link it with an image. note:
the root folder directory of ci_sample: - application - system - css bootstrap.css - js jquery.js bootstrap.js - .htaccess my changes at config.php: Code: $config['base_url'] = 'http://localhost/ci_sample/'; changes at autoload.php: Code: $autoload['helper'] = array('url', 'html'); .htaccess at root: Code: RewriteEngine On Code: <?php Code: <?php Code: <html> RE: Bootstrap.css not working - Pertti - 09-03-2018 Other than I'd probably change URL reference to base_url('css/bootstrap.css'), it seems like it should work. On Chrome, can you see any errors in Developer Tools, that's usually good place to identify any loading issues to pinpoint the error. RE: Bootstrap.css not working - InsiteFX - 09-03-2018 For one you should create an assets folder and place all of you css and js in to it. This is for an assets folder along with the index.php PHP Code: <!DOCTYPE html> Notice the top 3 line those are required by Bootstrap. This Example is from Bootstrap of the Basic Template: Code: <!DOCTYPE html> RE: Bootstrap.css not working - Wouter60 - 09-03-2018 For what it's worth: Code: <head> "stylsheet" should be "stylesheet". But you definitely should place the complete bootstrap folder structure inside a folder called "assets". The bootstrap.js javascript needs that (relative links). |