dongyunshan4066 2016-10-04 08:47
浏览 194
已采纳

如何使用codeigniter在css文件中设置base_url(),以访问css文件中的background_image_url?

I'm using codeigniter, I loaded all css files and those are working very well. My directory structure is displayed in following image:

enter image description here

I loaded style.cssusing this code :

<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets/css/style.css">

all style attributes are set very well and working. But after that I found images which are set inside css file are not displaying on my site! My code in css :

.social_nav li.facebook a{ background-image:url("images/socials.png"); background-position:0 -30px; background-size:270px 60px}

So is their any procedure to set base_url() for background-image:url("images/socials.png"

  • 写回答

3条回答 默认 最新

  • douji0073 2016-10-04 09:46
    关注

    I found answer after getting the help and finally understanding silly mistake of mine everything is working fine except the adblocker I disabled that and now images are displaying enter image description here

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误
  • ¥15 用visual studi code完成html页面