Link Css File in Codeigniter

Here is following way to add css in your view file.....

First Method-:  put your css file in your folder at root directory
    go ot view file and add following code in head section.

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

Second Method-: put this code in your before starting of html code in your view file
    <?php $this->load->helper('html');?>
after this add following code in your head section
 <?php echo link_tag(base_url().'style/style.css') ;?>

Note:if you do not want to write this code <?php $this->load->helper('html');?> in your view file,
Go to Application->Config->autoload.php
and change following codes
before
$autoload['helper'] = array();
replace
$autoload['helper'] = array("url","html");

Thanks

Comments

Popular posts from this blog

How to Create Secondary Menu in Squarespace

How to show Squarespace gallery in Masonry view

Don't Crawl Posts,Categories Using Meta Tags in Wordpress