Error en WebKit:: regla del último hijo sobre causas de elementos no existentes: nth-child havoc

When an empty last-child rule is applied to all td tags while a tr tag does not contain any, the nth-child rules are not applied correctly.

For example, this CSS:

tr:nth-child(odd) td {
    background: #27d;
}

tr:last-child td:last-child {
}

con este HTML:

<table> 
    <tr><th colspan="10"></th></tr>
    <tr><td></td>[10 times]</tr> 
    <tr><td></td>[10 times]</tr> 
    ...
</table> 

works correctly in Firefox 5.0.1 (it prints alternatively blue and white lines) and Safari 5 but not in Safari 5.1 and Chrome 13.0.782.215:

Strange behavior in WebKit

http://www.jill-jenn.net/drafts/zebra-striping/

Something even more surprising: when you embed the CSS code instead of linking to it, the behavior is different in WebKit.

Another strange behavior in WebKit

http://www.jill-jenn.net/drafts/zebra-striping/nolink.html

I already made a ticket on Apple's Bug Reporter, but I wanted to know if anyone had found something similar.

preguntado el 27 de agosto de 11 a las 18:08

This is not a place for bug reports or for telling people about bug reports. -

Please provide the bug, and also make sure that you ask a question in your stack overflow question! -

If the empty CSS rule :last-child rule is causing the issue then why not remove it since it is empty and is not needed. Also have you tried using :last-of-type en lugar de :last-child ? .. and both of your example links go to not found page -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.