Css – Codeigniter css not loading

codeignitercss

I have a big problem with css and codeigniter.. I am starting to think it is my permissions or am I going mad?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

<title>test</title>
<link rel="stylesheet" href="<?php echo base_url(); ?>/css/style.css" 
     type="text/css" media="screen"/>
</head>

<body>

<?php echo base_url(); ?>css/style.css

This is my header file, and as you can see i've even echoed it out just to make sure it is right and it is, when I view source of the page it seems fine.. but somehow it is not doing anything, this is my css just to show you the background should be gray:

body{

background: #b6b6b6;
margin 0;
padding 0;
font-family: arial;
 }

my base url is fine.. as it is echoed out and goes to the right place
$config['base_url'] = 'http://localhost/block/application';

I am really going mad what could be going wrong?

ht access:

Deny from all

Best Answer

If you want base_url() to output the proper url, simply pass in the path as a parameter.

base_url('path/to/stylesheet.css');