Welcome Guest, Not a member yet? Register   Sign In
css and CI 2
#1

[eluser]harshitha[/eluser]
I use this code to load my css file,but it not working.......
<link rel="stylesheet" href="<?php echo base_url();?>application/css/style.css" type="text/css" />
and
<link rel="stylesheet" href="<?php echo base_url();?>css/style.css" type="text/css" />
but Both code are not work .......
my file structurer is

applicaion
/css
/style.css
/view
/include
/header.php

Please Help me .......
thank you
#2

[eluser]sikko[/eluser]
You shouldn't place your css into the application folder.

Take the css folder out, at the same level as index.php.
Then call it with
Code:
<?php echo base_url(); ?>css/style.css

The reason it's not working is probably because of the .htaccess file in the application folder.
#3

[eluser]harshitha[/eluser]
Thanks it is work.......Big Grin
#4

[eluser]cideveloper[/eluser]
Small suggestion.

In the root directory set up an "assets" folder and in that folder put "images", "css", and "js" folders. That way in your main .htaccess file you will only need to specify the "assets" folder like below.

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|assets|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

It also de-clutters your root folder.




Theme © iAndrew 2016 - Forum software by © MyBB