V
V
vvanyazz2021-07-10 18:02:25
css
vvanyazz, 2021-07-10 18:02:25

How to refer to element of element in bem?

let's say I have a header__list element, how to name the header__list element exactly, as I know header__list-item means an element of the element and you don’t need to do this, maybe you need to make this element a block, like: list-headet or what?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaliy Pershin, 2021-07-10
@vvanyazz

maybe you need to make this element a block, like: list-headet or what?

Yes, in a block, but you don't need to add a header. The block should be named in such a way that it would be clear what it does, and not where it is located. And later you can mix the block, for example:
<div class="header">
    <h1 class="header__title">Title</h1>
    <p class="header__desc">Description</p>
    <ul class="header__list list">
      <li class="list__item"><a href="#" class="list__link">link</a></li>
      <li class="list__item"><a href="#" class="list__link">link</a></li>
      <li class="list__item"><a href="#" class="list__link">link</a></li>
    </ul>
  </div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question