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.
Asked
Active
Viewed 98 times
-3
-
What did you write? What do you see in the inspector & network tab? – SLaks Oct 02 '14 at 17:07
-
probably something to do with paths, whats the path that appears to you when you inspect the page? – CIRCLE Oct 02 '14 at 17:09
2 Answers
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
-
1Two 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
-
thanks ...all specially Ryan Kinal.. I solved my problem below is snipp – Nasim Bahar Oct 03 '14 at 10:59
-