我看到一些问题与您background
CSS属性...我会打破它
background: /* property name */
url(../img/bg-sprite.png) /* background-image */
repeat-x /* background-repeat */
0 -306px /* background-position */
bottom /* ummm... what?! */
...这样的浏览器无法解析您的CSS属性。如果您加载这个孩子在Firefox,并检查了错误控制台(“工具”>“错误控制台”),你会看到沿着线的东西:对 “背景”在解析值
错误。声明下降了。
所以我知道你在想什么......只是删除'底部',对吧?但随后发生的事情......
background: /* property name */
url(../img/bg-sprite.png) /* background-image */
repeat-x /* background-repeat */
/* background-position... */
0 /* x-position */
-306px /* y-position */
现在你的背景图像是由-306px
偏移,这可能不会在<div>
的底部。如果你真的不走运,它甚至会超过<div>
的底部,没人能看到你的背景图像。
因此,尝试更多的东西像这样...
background: url(../img/bg-sprite.png) repeat-x 0px bottom
或...
background: url(../img/bg-sprite.png) repeat-x -306px bottom
...取决于你为什么有这样的-306px
有摆在首位。
您可以使用伪元素http://stackoverflow.com/questions/8363535/how-to-position-an-image-sprite-at-the-bottom-of-an-element-of-unknown-height – mvod 2012-01-28 16:35:04