-1

bootstrap folder was placed in root folder. styles were loaded in header sections of view files like this. but it's not worked. please help to solve this.

    <link href="<?php echo base_url('bootstrap/css/bootstrap.min.css');?>" rel="stylesheet">
    <link href="<?php echo base_url('bootstrap/css/mystylesheet.css'); ?>" rel="stylesheet">

    <script src="<?php echo base_url('bootstrap/js/jquery.min.js'); ?>"></script>        
    <script src="<?php echo base_url('bootstrap/js/bootstrap.min.js'); ?>"></script>

    <title>::CMSys || Add Division::</title>
</head>
Udaya Kumara
  • 25
  • 1
  • 8

1 Answers1

1

You have forgot type="text/css"

<link type="text/css" href="<?php echo base_url('bootstrap/css/bootstrap.min.css');?>" rel="stylesheet">
<link type="text/css" href="<?php echo base_url('bootstrap/css/mystylesheet.css'); ?>" rel="stylesheet">

Make sure you have set your base url in the application config.php

Make sure you have the bootstrap folder out side of the application folder.

$config['base_url'] = 'http://localhost/yourproject/';

Or something like

$config['base_url'] = 'http://www.yourdomain.com/';

And autoload the url helper

$autoload['helper'] = array('url');

If not place it in the construct area of controller. http://www.codeigniter.com/user_guide/general/controllers.html#class-constructors

And make sure you have named your classes and filenames correct as explained here

  1. http://www.codeigniter.com/user_guide/general/styleguide.html#file-naming
  2. http://www.codeigniter.com/user_guide/general/styleguide.html#class-and-method-naming

You may need a htaccess file in the main directory try some of these https://github.com/wolfgang1983/htaccess_for_codeigniter

  • there is a spelling mistake in "$config['base_url'] = 'http://localhost/yourproject/'; ". then, styles worked. thank you for your guidance. – Udaya Kumara Aug 13 '17 at 16:09