内联css背景图像不工作

时间:2016-05-23 14:18:44

标签: php css codeigniter

这是我正在使用的代码

<div class="item active" style="background-image: url('https://this is url/urlwebsite.com/images/sliderbg1.jpg');">

enter image description here

帮助我解决问题的方法

2 个答案:

答案 0 :(得分:0)

该图像应该出现。这是示例

<div style="background-image:url(http://webneel.com/wallpaper/sites/default/files/images/01-2014/7-flower-wallpaper.jpg)">

小提琴 - https://jsfiddle.net/gLbn4dLm/

编辑:您尚未指定该DIV元素的高度。请指定该DIV元素的高度。

答案 1 :(得分:0)

尝试使用base_url()

<div class="item active" style="background-image: url('<?php echo base_url() ;?>images/sliderbg1.jpg');">
  

确保您的images文件夹位于项目的根目录(外部应用程序文件夹)中。