0

When I include the following code within my view file:

<link rel="stylesheet" href="<?php echo base_url();>css/libs/animate.min.css" type="text/css" media="all">

<!-- Font Awesome icon library -->
<link href="<?php echo base_url();?>css/libs/font-awesome.min.css" rel="stylesheet" type="text/css" media="all">

<!-- Load primary stylesheet -->
<link rel="<?php echo base_url();?>stylesheet" href="css/skin.css" type="text/css" media="all">

Nothing loads not even HTML content, but when I remove these lines HTML content loads properly. So how do I load my CSS files? They are in my assests/css

3
  • Check permission of your css folder Commented Nov 6, 2015 at 6:54
  • which server are you using ? Commented Nov 6, 2015 at 6:56
  • you are doing it wrong no body should use xamp or wamp... better to use linux server with vagrant or virtual machine Commented Nov 6, 2015 at 8:33

3 Answers 3

1

You have to load helper in config/autoload.php

$autoload['helper'] = array('url', 'file','form');
Sign up to request clarification or add additional context in comments.

4 Comments

yeah this shows html content but still css not shown
Ok. Check your base url in config/config.php $config['base_url'] = 'example.com'
$config['base_url'] = ' ';
have you put css folder on root?
0

in config.php]

$autoload['helper'] = array('url');

and base_url() should

$config['base_url'] = '';

Comments

0

you did mistaken to close the php script in first css linking you wrote .

 <?php echo base_url();> 

instead of

<?php echo base_url();?>

and also check that you have loaded url helper in your code or not ? use this

 <link rel="stylesheet" href="<?php echo base_url();?>css/libs/animate.min.css" type="text/css" media="all">//mistake in this line missing '?'

    <!-- Font Awesome icon library -->
    <link href="<?php echo base_url();?>css/libs/font-awesome.min.css" rel="stylesheet" type="text/css" media="all">

    <!-- Load primary stylesheet -->
    <link rel="<?php echo base_url();?>stylesheet" href="css/skin.css" type="text/css" media="all"> 

2 Comments

yeah i rectified this,also rectified this:<link rel="<?php echo base_url(); url helper there,but still css not loading
if you have rectified your code and also have loaded the url helper then error is not in that code check is your file exist in {{rootdirectory}}/css/libs/animate.min.css, and check what is your base_url value in your config file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.