如何在codeigniter中加载css文件的图像 [英] how to load images of css file in codeigniter

查看:124
本文介绍了如何在codeigniter中加载css文件的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有问题,加载图像在coedigniter,借助 base_url(),我成功加载CSS,但不幸的是图像不。
Actualy图像在css文件(style.css)中调用,所以要加载style.css我在html中改变像这样:

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" />

好,它正在加载所有样式和CSS,但图像不加载用于styl.css
css的预览:

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

推荐答案

尝试这样

body {
    background:url('../images/img04.jpg') repeat left top;
}

这篇关于如何在codeigniter中加载css文件的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆