V
V
vasil772017-11-18 01:16:30
css
vasil77, 2017-11-18 01:16:30

How to give proper naming to BEM classes?

How to give proper names to BEM classes? When there are blocks that are identical in design, but with a different background image, each block has its own. Do for each, for example, categories_img__one, for the next categories_img__two, or for each, write categories_img and then assign the class one, two, three, etc. to each block.
For example:

<div class="categories_box">
  <div class="categories_img__one">
              
  </div>
</div>
<div class="categories_box">
  <div class="categories_img__two">
              
  </div>
</div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dasha, 2017-11-18
@FinnishFox

<div class="categories__box">
  <div class="categories__img categories__img_one">
              
  </div>
</div>
<div class="categories__box">
  <div class="categories__img categories__img_two">
       
  </div>
</div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question