G
G
GreenMan18992019-07-07 15:02:36
css
GreenMan1899, 2019-07-07 15:02:36

Is it possible to do this in BEM?

<header>
  <a href="" class="logo"></a>
  <div class="main-menu__wrapper">
    <menu class="main-menu">
      <a href="" class="main-menu__item">О сервисе</a>
      <a href="" class="main-menu__item">Функции</a>
      <a href="" class="main-menu__item">Возможности</a>
      <a href="" class="main-menu__item">Партнеры</a>
    </menu>
    <a href="" class="btn">Оставить заявку</a>
  </div>
</header>

That is, it is assumed that the main-menu itself is used without a wrapper, and the wrapper is only needed to combine the menu with the button.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Proskurin, 2019-07-07
@Vlad_IT

Most likely, main-menu__wrapper is already part of the header, not the menu. Make it an element for the header.

<header class="header">
  <a href="" class="logo"></a>
  <div class="header__menu-container">
    <menu class="main-menu">
      <a href="" class="main-menu__item">О сервисе</a>
      <a href="" class="main-menu__item">Функции</a>
      <a href="" class="main-menu__item">Возможности</a>
      <a href="" class="main-menu__item">Партнеры</a>
    </menu>
    <a href="" class="btn">Оставить заявку</a>
  </div>
</header>

P
profesor08, 2019-07-07
@profesor08

A wrapper is a wrapper for an element to achieve the desired display, and I associate it with a single element. In this case, I would use other names, inspired by the Bootstrap 4 naming.

<header>
  <a href="" class="logo"></a>
  <div class="main-menu">
    <menu class="menu-nav">
      <a href="" class="menu-nav__item">О сервисе</a>
      <a href="" class="menu-nav__item">Функции</a>
      <a href="" class="menu-nav__item">Возможности</a>
      <a href="" class="menu-nav__item">Партнеры</a>
    </menu>
    <a href="" class="btn">Оставить заявку</a>
  </div>
</header>

So you have a main menu, it has a navigation me and some kind of button, or you can cram something else.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question