2012-08-24 146 views
16

我想从最后一个figure元素去除背景::最后孩子没有选择的最后一个元素

@media (min-width: 50em) { 
    #mission #press figure { 
    padding-left: 0; 
    background: url('/assets/img/splash-green.png?1345829368') no-repeat 50% bottom; 
    } 
    #mission #press figure:last-child { 
    background: none; 
    } 
} 

背景仍然显示。我误瞄准了吗?

+0

请向我们展示编译后的CSS或演示。 – Chris

+0

@ Abody97我用编译好的CSS更新了问题。谢谢。 – Yahreen

+0

它看起来很好 - 我有一些其他的CSS定义背景图片吗?演示会很棒。 – Chris

回答

18

我想你可能实际上是在寻找last-of-type而不是last-child的功能。

LINK

+0

这样做。谢谢。 – Yahreen

+0

嗨,感谢您的链接,如果您有时间可以在这里看看我的问题? http://stackoverflow.com/questions/16905061/last-child-and-last-of-type-not-working-in-sass不知道我在哪里将错误转换成符合SAS​​S的代码CSS –

相关问题