Welcome Guest, Not a member yet? Register   Sign In
How does CodeIgniter load images from a CSS file?
#1

I'm having trouble loading images in coedigniter. I was able to load css using base_url(), but not images. Images are called in a css file (style.css), therefore, to load style.css, I updated the HTML as follows:

Code:
<link href="<?php echo base_url('css/style.css'); ?>" rel="stylesheet" type="text/css" media="screen" />

Okay, all styles and css are loading, but the images used in the styl.css preview of css are not loading:

Code:
html, body { height: 100%; }
* {
    margin: 0;
    padding: 0;
}
body {
    background: url(images/img04.jpg) repeat left top;
}

So any idea or advice would be greatly appreciated. Thank you!
Reply
#2

If the ccss file is above your image folder then try this.

Code:
body {
    background: url(../images/img04.jpg) repeat left top;
}
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB