0 Replies - 179 Views - Last Post: 24 January 2013 - 11:51 AM Rate Topic: -----

#1 laytonsdad  Icon User is offline

  • Cheese and Sprinkles
  • member icon

Reputation: 403
  • View blog
  • Posts: 1,720
  • Joined: 30-April 10

Trouble understanding external css with codeigniter

Posted 24 January 2013 - 11:51 AM

Hello all,

I have been reading the docs for codeigniter and have added it to my xampp server for learning. I have got the implementation of views and I wanted to start to make some templates for head and foot but I am having trouble adding an external css file.

I have not changed the base_url and I was wondering what I should make it if my css location is such:

C:\xampplite\htdocs\ci\application\css\main.css


Also, what is the best way to add an external css file? I have found most answers to say add the base_url() to the href= string, which is why I ask what the base_url() should be set to.

Thank you for your time.



EDIT:
I was able to resolve the issue by leaving the base_url(); blank and moving the css folder out of the application folder. I am not sure that it is the best thing to do but it now works with:
<link ... href="<?php echo base_url(); ?>css/main.css"></link>

This post has been edited by laytonsdad: 24 January 2013 - 04:33 PM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1