How to make parent div activate styling of child div for hover and active

Use group-hover state

  1. Add group class to your parent element (anchor-tag in your case)
  2. Replace hover: with group-hover:

Worth to mention not every property supports group-hover, so there can be situation, where you may need to extend core plugins. More info about group-hover here

DEMO https://play.tailwindcss.com/dzacJTR76X

Leave a Comment