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

[eluser]Unknown[/eluser]
Sorry...

Where i must put css file in CI...?.

and how i access that css...?.

thank you...
#2

[eluser]rogierb[/eluser]
Basic HTML knowledge...

CSS has nothing to do with CI. Only with (x)HTML and how that works.

Code:
//in your view file
<link rel="stylesheet" type="text/css" href="<?php echo site_url('your_cssfolder/your_css_file.css')?>" />
#3

[eluser]Phil Sturgeon[/eluser]
Take a look at my Asset library for a more CodeIgniter handled way of doing things. It lets you put your CSS, images and JavaScript in modules and all sorts of handy things.

OR try the ridiculously easy method I highlighted on my blog. Even easier than the one posted before me.
#4

[eluser]bigtony[/eluser]
Or you could use the even simpler CI helper function:
Code:
<?php echo link_tag('assets/css/site.css'); ?>
#5

[eluser]Phil Sturgeon[/eluser]
Code:
<?php echo link_tag('assets/css/site.css'); ?>

vrs:

Code:
<?php echo css('site.css'); ?>

and even:

Code:
<?php echo css('site.css', 'modulename'); ?>

I think you'll find my library and helper is as simple (or even more so) than the CodeIgniter helpers and gives you much more flexibility. The benefit of using the Asset library now is that as I add in caching and minification features, you will have no work what-so-ever required to implement it.




Theme © iAndrew 2016 - Forum software by © MyBB