Odd HTML Selector

Catamarca Web
  • CMS & No-code
  • Web Development
  • SEO & GEO
  • Entrepreneurship
Eager newcomer Level 3
Posts
5
Like
0
Since
2018
Automatically translated from Spanish
Author #1

Good afternoon community, I'm back again with a question. I'm configuring an Adsense Inserter plugin and I wanted to know how (if possible) to indicate via an HTML selector that it should insert an ad after an image, but doing so every other image, that is:

If I have 5 images, that it inserts below the first, below the third, and below the fifth. (one yes, one no, one yes...). I hope I've explained myself well. The selector to insert below all the images is the following:

div#content-wrapper > div > p > img

Automatically translated from Spanish

1 replies

  1. Julio Rodríguez
    • SEO & GEO
    • CMS & No-code
    • Hosting & Servers
    • Web Development
    • Off-topic
    Regular Level 8
    Posts
    93
    Like
    0
    Since
    2026
    Automatically translated from Spanish

    Hello,

    it would be with NTH, here's an example for you:

    div#content-wrapper > div > p > img:nth.child(even)

    I'll leave you a link

    https://es.stackoverflow.com/questions/134945/seleccionar-todos-los-elementos-impares-pero-nth-of-typeodd-no-ayuda

    Automatically translated from Spanish

Sign in to take part in the forum.

This reply will be hidden. It is kept and can be restored.

Reason
or with your email