My css url is not working on codeigniter

0

Good morning, I'm learning to use codeigniter, and I have a problem in my css ... inside the applications folder I created another folder called layout, which inside it will have a header.php and a footer.php . When I access my view I call this header and footer. Until then, okay! in the applications folder it also has another folder named assets that has the following folders - css and sass .

In my header, I can not reach the css file ... in my autoload I configured the url, and in my config.php the default url looks like this:

$config['base_url'] = 'http://localhost:8888/project_system_hair/project/system_hair/';

And in my header.php it looks like this:

<link rel="stylesheet" type="text/css" href="<?=base_url('assets/css/teste.css')?>">

When executing and giving element inspect my href stays this way ...

<link rel="stylesheet" type="text/css" href="http://localhost:8888/project_system_hair/project/system_hair/assets/css/teste.css">

In other words, the path is correct ... but the console has an error saying:

GET link net :: ERR_ABORTED and so on I can not use my css.

asked by anonymous 21.01.2018 / 15:16

2 answers

0

I was able to solve my problem .... From what I was seeing, even if my base url is pointed to application, I will have it for the rest of the way.

My solution was, by the application / before getting it this way:

<link rel="stylesheet" type="text/css" href="<?=base_url('application/assets/css/teste.css')?>">

In this way, my css is "linked" correctly

Thank you guys

    
21.01.2018 / 18:01
0

Try to create your "layout" folder out of "applications", the structure looks something like this:

application
system
layout
    assets
       css
       sass
    
21.01.2018 / 17:28