Welcome Guest, Not a member yet? Register   Sign In
Load CSS
#1

[eluser]kezman[/eluser]
Hey!
I have a local project on CodeIgniter hosted on
Code:
localhost/

My .htaccess

Code:
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond $1 !^(index\.php|images|robots\.txt|css)
    RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

My css file

Code:
.temp {
    color: red;
}

My css file location

Code:
/application/views/css/mainpage.css

My Mainpage controller looks like this Smile

Code:
class Mainpage extends CI_Controller {

public function index()
{
                $this->load->helper('url');
                $this->load->helper('html');
                $data['content'] = 'Hey...we are on main one? really??';
                $this->load->view('maintemplate', $data);
}
}

My maintemplate.php view file

Code:
&lt;html&gt;
    &lt;head&gt;
        &lt;link rel="stylesheet" href='&lt;?php echo base_url();?&gt;application/views/css/maintemplate.css' type="text/css" media="screen, projection" /&gt;
    &lt;/head&gt;
    &lt;body&gt;
       <p class="temp">123</p>
    &lt;/body&gt;
&lt;/html&gt;

But text is not red.
1. What's wrong?
2. Is my style of placing css files good?


Messages In This Thread
Load CSS - by El Forum - 05-13-2012, 02:26 AM
Load CSS - by El Forum - 05-13-2012, 02:48 AM
Load CSS - by El Forum - 05-13-2012, 03:09 AM
Load CSS - by El Forum - 05-13-2012, 04:39 AM
Load CSS - by El Forum - 05-13-2012, 05:26 AM
Load CSS - by El Forum - 05-13-2012, 09:55 AM
Load CSS - by El Forum - 05-14-2012, 12:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB