0

I think I'm looking for something not possible, but let's try:

I need to select all the div elements with class="product-block" that contain an image with alt="ing1".

This is the code, for reference:

    <div class="product-block">
                          <div class="aos-animate">
                            <div class="image-wrap">
                    <img class="lazyautosizes lazyloaded" alt="ing1">
                            </div>
                          </div>
                        </div>
Sergey Panteleev
  • 122
  • 1
  • 1
  • 10
imones
  • 5
  • 2
  • 5
    Would be a use case for `:has()`, but no browser support apart from Safari yet. https://developer.mozilla.org/en-US/docs/Web/CSS/:has – CBroe Jun 09 '22 at 07:26
  • Why don't you add a unique class to the img with that `alt` and on the selector you add `.product-block > .img-class` – manjiro sano Jun 09 '22 at 08:03
  • @manjirosano because I need to select the "product-block", not the .img – imones Jun 09 '22 at 09:00

0 Answers0