Languages
[Edit]
EN

CSS - hover effect for two elements at the same time

0 points
Created by:
Elias999
819

In this article, we would like to show you how to apply hover effect for two or more elements at the same time using CSS.

Practical example

Edit

In the example below, we apply hover effect to two child elements by wrapping them into the parent element and assigning their styles on .parent class hover event.

 

See also

Edit
  1. CSS - hover one div to change another div element (multiple divs)

  2. CSS - hover child on parent

  3. CSS - hover parent on child

References

Edit
  1. :hover - CSS: Cascading Style Sheets | MDN

Alternative titles

  1. CSS - assign hover effect to two elements at the same time
  2. CSS - add hover effect to two elements at the same time
  3. CSS - hover 2 or more elements together
  4. CSS - hover multiple elements at the same time
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join