How to target two elements in div on hover

Viewed 21

Is it possible to write this css in one line instead of duplicating it and targeting a and b seperately?

.nav-element:hover > a {
  color: red;
}

.nav-element:hover > b {
  color: red;
}
<li class="nav-element">
  <a>Tt</a>
  <b>hh</b>
</li>

0 Answers
Related