CodeIgniter Forums

Full Version: Using CSS With CodeIghiter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]lenswipe[/eluser]
Hey guys

Im just trying to use CSS with my view files, i read http://codeigniter.com/wiki/css/ and it sort of works, except that it produces:
Code:
<link rel="stylesheet" href='http://localhost/helpdesk/css/style.css' type="text/css" media="screen" />

my actual css file is located in http://localhost/helpdesk/application/views/css/style.css i could hard code this in but i dont want to...

I could also just change the base_url option in config.php but i dont want to incase that breaks stuff..


can someone help?

El Forum

[eluser]jtrainaldi[/eluser]
I typically have my Javascript and CSS folders outside the application directory. I dont' know if that is best practice but you will then be able to utilize the base_url() function without changing it to accomodate your current setup.

-application
-config
-controller
-...
-...
-css
-js
-system

El Forum

[eluser]lenswipe[/eluser]
[quote author="jtrainaldi" date="1302891637"]I typically have my Javascript and CSS folders outside the application directory. I dont' know if that is best practice but you will then be able to utilize the base_url() function without changing it to accomodate your current setup.

-application
-config
-controller
-...
-...
-css
-js
-system[/quote]

thanks, i might pass up on doing that myself as i prefer to keep all my frontend stuff in the views folder, for convention

El Forum

[eluser]InsiteFX[/eluser]
Code:
application
system
assets
-- css
-- js
-- scripts
-- img
-- images
index.php

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

InsiteFX

El Forum

[eluser]William Rufino[/eluser]
You should use your app folder outside the public_html folder........ thats why you should have a public/assets folder

El Forum

[eluser]Nur Cholikul Anwar[/eluser]
Please check .htaccess on your application folder, maybe set "deny all"?

El Forum

[eluser]InsiteFX[/eluser]
It's to deny all for a reason!

El Forum

[eluser]Nur Cholikul Anwar[/eluser]
Thats i think, maybe you can remove .htaccess file