Skip to content Skip to sidebar Skip to footer

How To Access Css File Inside A Folder In Codeigniter Application?

I am creating a web page and trying to access a stylesheet which is inside a 'application/css/' folder. So how we can access this file and what helper function should use? Below is

Solution 1:

It is Not Recommended that you have css or images in applications folder

Create a assets folder in main directory

application
assets
assets > css
assets > images
assets > js
system
index.php

On view use example <?php echo base_url('assets/css/stylesheet.css');?>

Autoload the url helper also.


Solution 2:

<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Home</title>
<link href="<?php echo base_url('assets/css/style.css'); ?>" />
</head>

Post a Comment for "How To Access Css File Inside A Folder In Codeigniter Application?"