S
S
Senseich2018-03-11 12:28:39
css
Senseich, 2018-03-11 12:28:39

How to correctly record according to BEM using the example of a menu?

Hello! I decided to master the BEM methodology, but I don’t understand something completely. As I understand it, the point is to give each tag an individual class.
You can use the example of a simple menu to show how to write correctly in html and css.
For example, there is a code:

<div class="menu">
    <ul>
      <li><a href=""></a></li>
      <li><a href=""></a></li>
      <li><a href=""></a></li>
    </ul>
  </div>

How to rewrite it in BEM?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2018-03-11
@Senseich

<nav class="menu">
  <ul class="menu__list">
    <li class="menu__item menu__item_state_active"><a class="menu__link" href=""></a></li>
    <li class="menu__item"><a class="menu__link" href=""></a></li>
    <li class="menu__item"><a class="menu__link" href=""></a></li>
  </ul>
</nav>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question