2011-11-18, 21:30:34
Connie Wrote:Now I want to change the background-images for h2, using :nth-child-property, but I have no success
The n'th child must be applied to the slide, not the h2 (because there is only one h2:
Code:
#content .gallery .gallery-slide:nth-child(1) h2 { ... }
#content .gallery .gallery-slide:nth-child(2) h2 { ... }
You can also do it using CSS2:
Code:
#content .gallery .gallery-slide h2 { ... }
#content .gallery .gallery-slide + .gallery-slide h2 { ... }
#content .gallery .gallery-slide + .gallery-slide + .gallery-slide h2 { ... }