M
M
Muvka2019-06-01 19:16:08
BEM
Muvka, 2019-06-01 19:16:08

How to correctly change a child block when hovering over a parent block in BEM?

There is a block block. There is a button in the block - also a separate button block. According to BEM, how to change the state of a button when hovering over the parent block block? .block:hover .button is not correct. Substitute class for button when hovering over parent using js?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alex, 2019-06-01
@Muvka

for example like this:

<div class="block">
  <div class="block__button button"></div>
</div>

.block:hover .block__button {...}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question