Welcome Guest, Not a member yet? Register   Sign In
css problems
#1

[eluser]kkoncept[/eluser]
I did a search and saw several threads that came close to answering my question but didn't quite get there. I'm trying to link to an external style sheet with the following code in my view file using base_url():

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
&lt;html&gt;
    &lt;head&gt;
        &lt;meta content="text/html; charset=UTF-8" http-equiv="content-type" /&gt;
        &lt;title&gt;&lt;?=$title?&gt;&lt;/title&gt;
        &lt;link rel="stylesheet" type="text/css" href="&lt;?php echo base_url();?&gt;css/styles.css" /&gt;
    &lt;/head&gt;
    &lt;body&gt;
        <div class="header"><img src="&lt;?php echo base_url();?&gt;images/logo.gif" alt="LOGO" /></div>
        <br />
        <div class="content">Some content here</div>
    &lt;/body&gt;
&lt;/html&gt;


My directory structure is

Code:
/public_html
..css
..images
..system

and my controller code is this:

Code:
&lt;?php

class Home extends Controller {
    
    function Home()
    {
        parent::Controller();
        
        $this->load->helper('url');
        $this->load->helper('form');
        
    }
    
    function index()
    {
        
        $data['title'] = 'Welcome';
        $this->load->view('home_view', $data);
    }
}

?&gt;

Everything seems to be working except that the css isn't getting applied. As you can see, I am using the same technique to link to my images folder. The weird part is that it works for the images folder but not the css folder.

Could the problem be in the css file itself? The code for that is here:

Code:
#header {
background-image: /images/headerbg.gif;
}

#content {
font-style: italic;
}

Thanks in advance for any enlightenment.


Messages In This Thread
css problems - by El Forum - 09-10-2008, 08:54 PM
css problems - by El Forum - 09-10-2008, 09:08 PM
css problems - by El Forum - 09-10-2008, 09:24 PM
css problems - by El Forum - 09-10-2008, 09:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB