1. Open "config.php" within directory CodeIgniter\system\application\config.
2. Add following code. At last line before '?>'
$config['css'] = 'mystyles.css';
3. Create a file named mystyles.css within root.
4. Enter example code like this:
h1{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:30px;
}
p{
font-family:Georgia, "Times New Roman", Times, serif;
font-size:12px;
}
#menu{
height:50px;
}
.....etc
5. Open model file named "your_filename.php" within CodeIgniter\system\application\models.
6. Add following two lines.
<?php
class Blog extends CI_Controller {
function index()
{
$data['title']="This is my blog";
$data['heading']="Testing of blog page";
$data['base']= $this->config->item('base_url');
$data['css']= $this->config->item('css');
$this->load->view("blog_view",$data);
}
}
?>
7. Then, update "your_viewfile.php" within CodeIgniter\system\application\views.
8. Update <head></head>, like this:
<html>
<head>
<link rel="stylesheet" type="text/css" href="<?php echo "$base/$css"?>">
<title><?php echo $title;?></title>
</head>
<body>
<h1><?php echo $heading;?></h1>
</body>
</html>
Enjoy It.