0

I want something to happen on hover for my element, but I also want that hover to trigger changes for another class.

Here is what I have tried:

.meet:hover{
    color:#EE3A43 !important;
    background-color:rgba(255,255,255,.3) !important;
}

.meet:hover .trainerContent{
    opacity:.3;
}

Is what I am trying to achieve possible with just CSS?

Andrew
  • 379
  • 1
  • 2
  • 13
  • show your html! – dippas May 19 '17 at 18:00
  • this answered question may can help you.http://stackoverflow.com/questions/4502633/how-to-affect-other-elements-when-a-div-is-hovered – rheeantz May 19 '17 at 18:00
  • No problem. Second decalration will alter the child element with class `trainerContent` when its parent with class `meet` is hovered. – Todor Simeonov May 19 '17 at 18:01
  • Yes, as long `.trainerContent` is a child of `.meet`. – hungerstar May 19 '17 at 18:04
  • @TodorSimeonov this code is not working though. The div with class "trainerContent" does not show opacity when I hover my mouse over the div with class "meet". – Andrew May 19 '17 at 18:04
  • Is `trainerContent` a child of `meet`? Placing the HTML could be useful. – Todor Simeonov May 19 '17 at 18:06
  • @AndrewMcCracken *"this code is not working though"* show us the full code that isn't working so we can see. – Michael Coker May 19 '17 at 18:07
  • 2
    @MichaelCoker and somebody upvoted the question ... – vals May 19 '17 at 18:18
  • Lets close it ..... – Asons May 19 '17 at 20:01
  • Questions seeking help ("**why isn't, or how to make, this code working?**") must include the desired behavior, a _specific problem or error and the shortest code necessary_ to reproduce it **in the question itself**. Questions without **a clear problem statement** are not useful to other readers. See: [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve). – Asons May 19 '17 at 20:01
  • so what you mean is when you hover over an element, another element would make some changes on its style? –  May 19 '17 at 23:04

0 Answers0