除了第一个孩子和最后一个孩子之外的CSS选择器 [英] CSS selector for other than the first child and last child

查看:1503
本文介绍了除了第一个孩子和最后一个孩子之外的CSS选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做一个非常先进的网站。我的问题:可以选择除了:first-child :last-child ?我知道有一个:not()选择器,但它不适用于多个不在括号中。这是我有:

I am making a very advanced website. My question: Is it possible to select all the other children except for the :first-child and the :last-child? I know there is a :not() selector but it doesn't work with more than one not in the parentheses. This is what I have:

#navigation ul li:not(:first-child, :last-child) {
    background: url(images/UISegmentBarButtonmiddle@2x.png);
    background-size: contain;
}


推荐答案

> #navigation ul li:not(:first-child):not(:last-child)。

Try #navigation ul li:not(:first-child):not(:last-child).

这篇关于除了第一个孩子和最后一个孩子之外的CSS选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆