Codeigniter Menu

HTML CSS

Video

Sound

SEO


Jan 26
2011

Codeigniter CSS Stylesheets

Posted by bohemia in Untagged 

Codeigniter makes it very simple to add a stylesheet to any given view. A simple loaction to keep all css files is in a new folder called css which can be made directly inside the codeigniter installation. However, the main page will have slightly different syntax than all other views. For example, if the route for the home page is for a controller named home_page.php, the header view would use the following syntax for the stylesheet:
css/mystyle.css
Alternately, a controller file such as mycrud.php, the header file would have a stylesheet like:
/css/mystyle.css

However, if Codeigniter is installed in wamp or in a subfolder(like it comes out of the box), you may want to use ../css/mystyle.css for the path. Alternatively, for wamp and live websites., you can always use absolute paths such as http://mycodeigniterwebsite.com/css/mystyle.css or http://localhost/mycodeinitersite/css/mystyle.css.
Comments (0)add comment

Write comment

busy