Welcome Guest, Not a member yet? Register   Sign In
Unable call stylesheet
#1

[eluser]chrisferrill[/eluser]
I call my style sheet normal with <link rel.......... />

My page seems to not be seeing this piece of code is there something I need to do with the controller or model??
#2

[eluser]byde[/eluser]
Set this helper in your controller

http://ellislab.com/codeigniter/user-gui...elper.html

and use base_url(); for the complete URL then be sure the URL is ok

If not working paste a bit of your code
#3

[eluser]chrisferrill[/eluser]
I loaded the URL helper but still nothing happens.

If I put css into the main view file, everything works. I would like to just get my global stylesheet working and called correctly

thanks
#4

[eluser]theprodigy[/eluser]
set your css files in the path you normally would.
using an example path of '/assets/css/style.css', you would use one of the following
Code:
<link href="/assets/css/style.css" rel="stylesheet" type="text/css" />
or
Code:
<link href="<?php echo base_url(); >assets/css/style.css" rel="stylesheet" type="text/css" />
#5

[eluser]chrisferrill[/eluser]
Thank you so much!!! would this be the same if I am trying to reference a Jquery file??
#6

[eluser]theprodigy[/eluser]
yes, it would be the same for all css, js, and images.
#7

[eluser]pickupman[/eluser]
Although using absolute urls (http://www.site.tld), maybe easier to use, they are not as fast as using relative urls ('/assets/css/style.css'). The browser has to resolve your DNS for absolute links before downloading whereas a relative url does not.

My guess is that you did not have a leading "/" to start the url to your css file.




Theme © iAndrew 2016 - Forum software by © MyBB