0
$(function(){
$("#mainContainer #container:last-child").css("background-image","url('/images/content-title.png') no-repeat")
})
上面的代码没有工作,没有什么happend与我的最后一个孩子选择器有任何错误?
$(function(){
$("#mainContainer #container:last-child").css("background-image","url('/images/content-title.png')")
})
以上代码的工作,但它改变所有的#container的背景和重复-Y。
不仅最后孩子
我想是改变#container的背景图像的最后一个孩子和不重复
我的HTML
<div id="mainContainer">//width 930px margin 0 auto
<div id="container">//height 500px test background repeat-y
dynamic content here
</div>
</div>
是的jQuery或类似PHP或ASP.NET服务器语言生成动态内容?如果它在服务器端生成,我们可以看到它可能是什么样子? – BoltClock 2010-08-26 17:41:30
没关系,我放弃已经大声笑...是由PHP生成的,我只是在页脚上添加1个div。谢谢你回答我的问题 – user259752 2010-08-26 17:46:06