• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bootstrap.css not working

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. 

  • I removed the usage of index.php
  • I also tried putting the css and js folders inside an "assets" folder, doesn't work either

the root folder directory of ci_sample:
- application
- system
- css
- js
- .htaccess

my changes at config.php:
$config['base_url'] = 'http://localhost/ci_sample/';
$config['index_page'] = '';

changes at autoload.php:
$autoload['helper'] = array('url', 'html');

.htaccess at root:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
 pages controller (Pages.php):
   class Pages extends CI_Controller{
       public function view($page = 'home'){
           $data['title'] = ucfirst($page);
           $this->load->view('pages/'.$page, $data);
defined('BASEPATH') OR exit('No direct script access allowed');

$route['default_controller'] = 'pages/view';

$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
       <link rel="stylsheet" href="<?php echo base_url();?>css/bootstrap.css" type="text/css">
       <div class="container">
           <div class="row">
               <div class="col-md-6">
               <div class="col-md-6">
                   <img src="<?php echo base_url();?>images/fb4.jpg">
       <script src="<?php echo base_url();?>js/jquery.js"></script>
       <script src="<?php echo base_url();?>js/bootstrap.js"></script>

Messages In This Thread
Bootstrap.css not working - by fresh96 - 09-02-2018, 09:01 PM
RE: Bootstrap.css not working - by Pertti - 09-03-2018, 12:56 AM
RE: Bootstrap.css not working - by InsiteFX - 09-03-2018, 09:05 AM
RE: Bootstrap.css not working - by Wouter60 - 09-03-2018, 01:03 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.