Hover in two divs within the same column

0

My question is this: I have a column with a text and an icon, I need the text and the icon to change color when the mouse is over the column:

.features .round-icon {
  border: 4px solid #1c1c1c;
  border-radius: 50%;
  display: table;
  height: 100px;
  width: 100px;
  font-size: 3.6rem;
}

.features .round-icon span {
  color: #1c1c1c;
  display: table-cell;
  text-align: center;
  vertical-align: middle;
}

#numeros-coluna2:hover{background-color:#ffc600;}
<div class="row features">
  <div class="medium-2 columns border-direita" id="numeros-coluna2">
    <span class="numeros">5MIL</span>
    <div class="round-icon medium-offset-2">
      <span class="fi-dollar"></span>
    </div>
  </div>
</div>
    
asked by anonymous 16.03.2017 / 15:28

2 answers

0

What you can do is to properly select the child elements from the hover event of the parent element. For example, if you want to change both the font color and the border of the child elements, you can do the following:

.features .round-icon {
  border: 4px solid #1c1c1c;
  border-radius: 50%;
  display: table;
  height: 100px;
  width: 100px;
  font-size: 3.6rem;
}

.features .round-icon span {
  color: #1c1c1c;
  display: table-cell;
  text-align: center;
  vertical-align: middle;
}

.features .columns:hover span {
  color: red;
}

.features .columns:hover div {
  border-color: red;
}
<div class="row features">
  <div class="medium-2 columns border-direita" id="numeros-coluna2">
    <span class="numeros">5MIL</span>
    <div class="round-icon medium-offset-2">
      <span class="fi-dollar">$</span>
    </div>
  </div>
</div>
    
16.03.2017 / 15:51
0
<style>
  .features .round-icon {
    border: 4px solid #1c1c1c;
    border-radius: 50%;
    display: table;
    height: 100px;
    width: 100px;
    font-size: 3.6rem;
  }

  .features .round-icon span {
    color: #1c1c1c;
    display: table-cell;
    text-align: center;
    vertical-align: middle;
  }

  .features .columns:hover .numeros {
      color: #F00;
  }

  .features .columns:hover .round-icon span {
      color: #F00;
  }

  .features .columns:hover .round-icon {
    border: 4px solid #F00;
  }
</style>

<div class="row features">
  <div class="medium-2 columns border-direita" id="numeros-coluna2">
    <span class="numeros">5MIL</span>
    <div class="round-icon medium-offset-2">
      <span class="fi-dollar"></span>
    </div>
  </div>
</div>
    
16.03.2017 / 15:50