-2

I am looking for a selector which applies to any div element that contains an element identified by the p.my selector

<div>
 <p class="my">
  prova
 </p>
</div>
Revious
  • 7,383
  • 30
  • 94
  • 142

1 Answers1

2

No, there is no specific parent selector in CSS, but I know two other ways:

  1. You just give the <div> a class or id.
  2. You could install jquery and use: $('p.my').parent().css({/*some css*/});