0

The question is about using css stylesheets in your assets folder within the code igniter framework. If I want to reference a certain image for a css style, lets say for instance, background: url('../images/some_image.gif'). How should I reference this image, and what url should I provide. I'd like to do this in a way that I can put my image file in the image folder within assets.

1 Answer 1

1

There's no difference in regards to this because you're using Codeigniter, you can use /absolute/paths, full URLs, or probably the easiest way - relative urls.

The url to the image can just be relative to the <link>ed CSS file.

Example:

-assets
   -css
      screen.css
   -images
      bg.png

In your HTML:

<link rel="stylesheet" type="text/css" href="/assets/css/screen.css">

From screen.css:

background:url(../images/bg.png);
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.