-3

In css file of my Code Igniter project, if i try to include any image file as background then it is not working. Any one CodeIgniter expert please help me. How to make a background-image(file name) work in code Igniter.

Nasim Bahar
  • 115
  • 3
  • 13

2 Answers2

2

What Ryan said is correct, just don't forget to put quotes (or single quotes) around the file name/location.

If this isn't the issue, could you provide the code that you have?

Steve
  • 129
  • 13
  • Dear Steve without codigniter it work perfectly but with codigniter whin I load this view it does'nt work – Nasim Bahar Oct 02 '14 at 17:18
  • 1
    Two things. Firstly, use single quotes for the image in this case as this is inline styling. Secondly, you're using percentage values for width and height is also a problem here. You can see more about problem #2 here: http://stackoverflow.com/questions/8262852/css-height-in-percent-not-working – Steve Oct 02 '14 at 17:26
  • thanks....my dear now I solve the problem.... below is the solution... **background-image:url(** – Nasim Bahar Oct 03 '14 at 13:01
0

CSS uses the following:

.your-class {
    background-image: url(file name);
}
Ryan Kinal
  • 17,414
  • 6
  • 46
  • 63