问题
i have problem to load images in coedigniter, with the help of base_url()
, i succeed to load css but unfortunately images not.
Actualy images are called in css file(style.css), so to load style.css i changed in html like this:
<link href="<?php echo base_url('css/style.css'); ?>" rel="stylesheet" type="text/css" media="screen" />
okay it is loading all style and css but the image are not loading which is used in styl.css preview of css:
html, body { height: 100%; }
* {
margin: 0;
padding: 0;
}
body {
background: url(images/img04.jpg) repeat left top;
}
so any idea any suggestion will be highly appreciate. thank you
回答1:
Try like this
body {
background:url('../images/img04.jpg') repeat left top;
}
来源:https://stackoverflow.com/questions/16749614/how-to-load-images-of-css-file-in-codeigniter