CodeIgniter Forums
where to put style sheets and images?? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: where to put style sheets and images?? (/showthread.php?tid=26213)



where to put style sheets and images?? - El Forum - 01-08-2010

[eluser]dadamssg[/eluser]
where do you put your style sheets and how you do reference them to use in your views? i put my style sheet in my view folder and tried to call it like so with no avail

<link rel='stylesheet' type='text/css' href='silk.css' />


where to put style sheets and images?? - El Forum - 01-08-2010

[eluser]JHackamack[/eluser]
Linked stylesheets belong between the <head></head> tags in HTML.


where to put style sheets and images?? - El Forum - 01-08-2010

[eluser]WebsiteDuck[/eluser]
One way is to create a css folder in your root directory (alongside application, system, etc) and do this in your view:
Code:
<link href="<?php echo base_url(); ?>css/stylesheet.css" rel="stylesheet" type="text/css" />

If you want to put the css files in your view folder you can add the folders in like so:
Code:
<link href="<?php echo base_url(); ?>application/views/css/stylesheet.css" rel="stylesheet" type="text/css" />



where to put style sheets and images?? - El Forum - 01-08-2010

[eluser]JHackamack[/eluser]
I must have misread the context. I create a folder structure like such:

/Application/Resources/CSS
/Application/Resources/Images
/Application/Resources/Javascript

and store things there (where application is the app name)


where to put style sheets and images?? - El Forum - 01-08-2010

[eluser]dadamssg[/eluser]
awesome, thanks fellas