• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
css are not loading

#11
Well I got this working, so going to leave this here in case it helps any one else or for further comment.
I moved my css files into a folder at the same level of the application folder (i.e as a sibling).
With the css files in the root of this folder the css would load correctly, placing them in a another folder level beneath this and they would not load.
So I moved the css into a folder under the application folder called assets and placed my css in a folder in this folder and all works.
So I got my templates working but why would CI not load the css in my first attempts?
EG
localhost/codeigniter/bootstrap/css/bootstrap.min.css -- DOESNT WORK

localhost/codeigniter/bootstrap/css/files/bootstrap.min.css -- DOESNT WORK

localhost/codeigniter/css/bootstrap.min.css -- WORKS

localhost/codeigniter/application/assets/css/bootstrap.min.css -- WORKS
Reply

#12
That's because your paths are wrong.

CodeIgniter User's use a folder structure like this:

./application
./system
public or public_html
-- assets
---- css
---- fonts
---- img
---- images
---- js
index.php

Then you can access all your files like this:


Code:
<!-- Bootstrap CSS file -->
    <link href="<?php echo base_url('assets/css/bootstrap.min.css'); ?>" rel="stylesheet">

Hope that helps.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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