Welcome Guest, Not a member yet? Register   Sign In
Accessing Image On CSS with Codeigniter
#4

(This post was last modified: 07-09-2016, 02:40 AM by gxgpet. Edit Reason: fixed paths )

Hi wolfgang1983,

ciadmin is trying to tell you that you should access the CSS file by pointing out directly the path; so, accessing the CSS file should work this way:

Code:
background: url('./assets/catalog/images/holder.png');


If your project is itself in a subfolder, then you should add that part too:

Code:
background: url('./projects/my_project/assets/catalog/images/holder.png');

However, as a good practice to point to any of your assets (CSS, JavaScripts, images etc.) you can use the base_url() function from CodeIgniter. More about it here. However, based on your current project structure, you can't use it for this situation because the CSS files don't get processed by PHP, so the function won't be actually called.

Hope this helps! Smile
Reply


Messages In This Thread
RE: Accessing Image On CSS with Codeigniter - by gxgpet - 07-09-2016, 01:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB