What's given: I have a HTML that's generated by external application and unfortunatly can't be changed. It basically includes container div with lot of child elements, some of wich are nested, like this:
<div class="parent">
<div class="child"></div>
<div class="child"></div>
<div>
<div class="child"></div>
<div class="child"></div>
</div>
<div class="child"></div>
<div class="child"></div>
</div>
Expected result: I'm trying to use CSS3 animation and animation delay to create nice effect that all list elements quickly fade in with slight delay one after another. CSS goes like this:
.container .child {
animation: FadeIn 1s ease-out;
}
.container .child:nth-child(1){
animation-delay: 0.2s
}
.container .child:nth-child(2){
animation-delay: 0.4s
}
.container .child:nth-child(3){
animation-delay: 0.6s
}
.container .child:nth-child( .... ){
animation-delay: 0.8s
}
Problem: As you may understand, animation works great if all elements are directly inside .container DIV. But as soon as some divs are nested, animation breaks out of order. Is it possible to somehow select all .child elements one after another, despite them being nested in additional DIV?
EDIT: to avoid any confusion - I'm trying to achieve this without any JS - just pure CSS approach!
Thanks in advance.