P
P
pacman1232018-11-04 19:53:41
BEM
pacman123, 2018-11-04 19:53:41

Is this BEM markup correct?

Is this markup correct?

<section class="header">
  <div class="header__container">
    <ul class="header__menu">
      <li class="header__item header__item_first">lunamen.studio</li>
      <li class="header__item">дизайн</li>
      <li class="header__item">технологии</li>
      <li class="header__item">функционал</li>
      <li class="header__item">стоимость</li>
      <li class="header__item">контакты</li>
    </ul>
    <button class="header__button">заказать</button>
  </div>
</section>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2018-11-04
@pacman123

There are no errors, but without the full picture it is difficult to say.
For example, it's better to make the "Order" button a block and mix it with the header__button class. It will be like this:
In the block class, set the design, and in the element class - external positioning. You need to do this because the button will most likely be used a lot more on the site, and you need the ability to pull out the button in a vacuum (which is not positioned in any way) and insert it anywhere.
The same with the menu. If it is used somewhere else besides the header (for example, in the footer), then it makes sense to change "header__menu" to "menu header__menu", and make li elements menu, not header.
It all depends on the design.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question