How can I target first iframe to fifth iframe using css?

Viewed 77

I am working on css, for me code is getting dynamically so I putting a screen shot for your referenceenter image description here

Now can you please tell me how to apply display block form first iframe, to fifth iframe using nth child, I tried it but it's not working.

If you have any questions please let me know.

3 Answers

Here's my solution:

#wrapper iframe:nth-child(-n+5) {
  display: block;
}

Then keep the first 5 iframe in a div with class name="display-block" , then in CSS:

.display-block iframe{
    display:block;
}

Give id 'display-block' from 1st to 5th iframe and then add css-

#display-block{
    display:block;
}
Related