初始化在CSS图象背景我有初始化变量从这个目录获取如图使用PHP可变
<?php $imgSrc = base_url()."decoy/thumbs/".$item["filename"]; ?>
现在我想将变量到CSS代码块的背景URL指定为示出,但它是不显示图像背景
<div style="background: url('<?php echo $imgSrc ?>') no-repeat;" class="large"></div>
任何人都可以亲切地帮助我如何我可以实现上述。
你确定你的'$ imgSrc'是给你正确的网址是什么? – Samundra
echo $ imgSrc – paranoid
我做了类似的工作,它工作正常 >>>>> parker