Estoy haciendo un sitio web muy avanzado. Mi pregunta: ¿Es posible seleccionar todos los demás hijos excepto el :first-childy el :last-child? Sé que hay un :not()selector, pero no funciona con más de uno que no esté entre paréntesis. Esto es lo que tengo:
#navigation ul li:not(:first-child, :last-child) {
background: url(images/UISegmentBarButtonmiddle@2x.png);
background-size: contain;
}
html
css
css-selectors
Daniel
fuente
fuente

Respuestas:
Prueba
#navigation ul li:not(:first-child):not(:last-child).fuente
not()incluso intentar esto antes de buscar en Google: P geniusnot (A and B)no es igual a(not A) and (not B), preferiría serlo(not A) or (not B). No funciona.Seguro que funcionará, solo tienes que usar dos selectores "no".
Continuará en la línea después del primero, diciendo "no el primer hijo" y "no el último hijo".
fuente