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条)

报告相同问题?