Welcome Guest, Not a member yet? Register   Sign In
Unable to get css on page
#1

Hi

I am trying to get css called in but I am getting errors .

what should I do .

pfa!!


Thanks

Attached Files Thumbnail(s)
   
Reply
#2

You probably need to link to your files using base_url() which you can read about here: http://www.codeigniter.com/user_guide/he...l#base_url

So in the head you would have for style sheets something like:

PHP Code:
<link href="<?php echo base_url('assets/bootstrap/css/bootstrap.min.css'); ?>" rel="stylesheet"

and for your footer js links something like:

PHP Code:
<script src="<?php echo base_url('assets/bootstrap/js/bootstrap.min.js'); ?>"></script

Hope that helps,

Best wishes,

Paul.
Reply
#3

(This post was last modified: 09-28-2015, 11:11 PM by freddy.)

Yes you should check your js and css by using helper codeignter, if you think already did then press ctrl+u then click on css or js, don't forget to autoload url
Reply
#4
Thumbs Up 

(09-28-2015, 12:35 PM)PaulD Wrote: You probably need to link to your files using base_url() which you can read about here: http://www.codeigniter.com/user_guide/he...l#base_url

So in the head you would have for style sheets something like:


PHP Code:
<link href="<?php echo base_url('assets/bootstrap/css/bootstrap.min.css'); ?>" rel="stylesheet"

and for your footer js links something like:


PHP Code:
<script src="<?php echo base_url('assets/bootstrap/js/bootstrap.min.js'); ?>"></script

Hope that helps,

Best wishes,

Paul.

Thanks PaulD
its working fine now !!
Smile Smile Smile Smile
Reply
#5

Thanks freddy now its working fine !!!!
Reply
#6

You could also just use an absolute url, starting with a / to start from site root:
<link href="/assets/bootstrap/css/bootstrap.min.css" rel="stylesheet">
Reply
#7

(10-05-2015, 11:50 AM)CroNiX Wrote: You could also just use an absolute url, starting with a / to start from site root:
<link href="/assets/bootstrap/css/bootstrap.min.css" rel="stylesheet">

Hi,

Thanks CroNiX  I will do this as well ..
Reply




Theme © iAndrew 2016 - Forum software by © MyBB