How to change color on every element in div when hovering?

john

I am trying to change the color of content, including h4 title, when hovering over div but the title does not get white colored. Don't know how I can achieve this:

.iconbox-blue {
  background: #fff;
  color: #000;
}

.iconbox-blue:hover {
  color: #fff;
  background: blue;
}
<div class="iconbox-blue">
  <a href=''>
    <h4 class="icon-box-title">Header</h4>
  </a>
  <p class="icon-box-content">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit.
  </p>
</div>

What am I doing wrong? How can I make the h4 title color white when hovering over iconbox-blue div?

MarLMazo

You just need to simply add a hover effect that changes the anchor-element. As anchor tag does not inherit attributes like if an href attribute is present.

.iconbox-blue:hover a{
  color: #fff;
}

.iconbox-blue {
  background: #fff;
  color: #000;
}

.iconbox-blue:hover {
  color: #fff;
  background: blue;
}
.iconbox-blue:hover a{
  color: #fff;
}
<div class="iconbox-blue">
  <a href=''>
    <h4 class="icon-box-title">Header</h4>
  </a>
  <p class="icon-box-content">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit.
  </p>
</div>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

change color of both text and link when hovering over element

From Dev

How to change the background color of a ListBox Item when hovering?

From Dev

Highcharts: how to change line color when hovering a scatterplot series

From Dev

How to change text color (and background) on nav bar links when hovering?

From Dev

How to change text color (and background) on nav bar links when hovering?

From Dev

How to change the background color of a ListBox Item when hovering?

From Dev

how to make color change to white when hovering over button

From Dev

How to change color of text when hovering on anything on a card?

From Dev

How to change opacity of child-element when hovering his parent

From Dev

How to scroll up a div when hovering over another element

From Dev

Change background color of row when hovering

From Dev

Change image color when hovering over li

From Dev

How to change every character while hovering?

From Dev

Why does the <li> element not change color and width when I hover the mouse over it after hovering over the image?

From Dev

Change css class when hovering html element

From Dev

Change background of the parent when hovering a child element

From Dev

Change colors of spans when hovering parent div

From Dev

Change colors of spans when hovering parent div

From Dev

how to change background color of an element shortly on every click

From Dev

Change color of every div element with the same class if another element is equals some text

From Dev

change color of all p element when it's div is hovered

From Dev

How to change span style while hovering a div?

From Dev

How to make an element active on hover, and remain active when im hovering over another specific div

From Dev

Change div image with transition when hovering an other div (ONLY CSS)

From Dev

Change class of other div when hovering on one div

From Dev

Change color of every second element in RecyclerView

From Dev

Highcharts : Change color of series when hovering other series

From Dev

Change combobox item back color when hovering over it

From Dev

Change Color of Icon When Hovering Over Adjacent Text With jQuery

Related Related

  1. 1

    change color of both text and link when hovering over element

  2. 2

    How to change the background color of a ListBox Item when hovering?

  3. 3

    Highcharts: how to change line color when hovering a scatterplot series

  4. 4

    How to change text color (and background) on nav bar links when hovering?

  5. 5

    How to change text color (and background) on nav bar links when hovering?

  6. 6

    How to change the background color of a ListBox Item when hovering?

  7. 7

    how to make color change to white when hovering over button

  8. 8

    How to change color of text when hovering on anything on a card?

  9. 9

    How to change opacity of child-element when hovering his parent

  10. 10

    How to scroll up a div when hovering over another element

  11. 11

    Change background color of row when hovering

  12. 12

    Change image color when hovering over li

  13. 13

    How to change every character while hovering?

  14. 14

    Why does the <li> element not change color and width when I hover the mouse over it after hovering over the image?

  15. 15

    Change css class when hovering html element

  16. 16

    Change background of the parent when hovering a child element

  17. 17

    Change colors of spans when hovering parent div

  18. 18

    Change colors of spans when hovering parent div

  19. 19

    how to change background color of an element shortly on every click

  20. 20

    Change color of every div element with the same class if another element is equals some text

  21. 21

    change color of all p element when it's div is hovered

  22. 22

    How to change span style while hovering a div?

  23. 23

    How to make an element active on hover, and remain active when im hovering over another specific div

  24. 24

    Change div image with transition when hovering an other div (ONLY CSS)

  25. 25

    Change class of other div when hovering on one div

  26. 26

    Change color of every second element in RecyclerView

  27. 27

    Highcharts : Change color of series when hovering other series

  28. 28

    Change combobox item back color when hovering over it

  29. 29

    Change Color of Icon When Hovering Over Adjacent Text With jQuery

HotTag

Archive