2

Currently I am using CodeIgniter_2.1.3 and my problem is my css file is not work, but i think it load well because when I view the source code and click the following href link it help me to view the css file.

<link rel="stylesheet" type="text/css"
   href="http://localhost/CodeIgniter/_css/style.css"   
   media="screan" charset="UTF-8" title="no title" /> 

I keep my css file in CodeIgniter/_css directory and I use the following code ::

<link rel="stylesheet" type="text/css" 
   href="<?php echo base_url('_css/style.css');?>"   
   media="screan" charset="UTF-8" title="no title" /> 

I also use the following but no effect.

<link rel="stylesheet" type="text/css" 
   href="<?php echo base_url();?>_css/style.css"   
   media="screan" charset="UTF-8" title="no title" /> 
1
  • yes, you are write, It works very well, many many thanks Commented Jul 3, 2013 at 0:21

2 Answers 2

0

Make sure you have loaded URL helper :

$this->load->helper('url');

Inspect using firebug or other web development tools for browsers if valid link has been printed on your link href.

If everything seems fine, then refresh the page. Ctrl + F5 which fetches the file from server again.

URL Helper: Codeigniter Guide

Sign up to request clarification or add additional context in comments.

Comments

0

Is that localhost address what you're using? That's only going to work if you're running the browser on your server . . . spelling screen correctly would help as well.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.