A
A
aiss2016-09-08 13:04:56
css
aiss, 2016-09-08 13:04:56

How should BEM classes be called here?

What are the BEM classes

<div class="advantages__wrap clearfix">

  <div class="advantages__item">
    <div class="???">
      <img class="???" src="img/advantages/1.png" alt="image">
    </div>
    <div class="???">
      <h3 class="???">Опыт работы</h3>
      <p class="???">Более 8 лет мы занимаемся архитектурной подсветкой зданий</p>
    </div>
  </div>
  

</div>

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Andrey Inishev, 2016-09-08
@inish777

advantages__image, advantages__text
https://en.bem.info/methodology/quick-start/#nesting-1

D
Dmitry Kravchenko, 2016-09-08
@mydearfriend

I recommend using mixes . thus:

<div class="advantages__wrap clearfix">

  <div class="advantages__item advantage">
    <div class="advantage__image-wrap">
      <img class="advantage__image" src="img/advantages/1.png" alt="image">
    </div>
    <div class="advantage__content">
      <h3 class="advantage__head">Опыт работы</h3>
      <p class="advantage__text">Более 8 лет мы занимаемся архитектурной подсветкой зданий</p>
    </div>
  </div>
</div>

M
Michael, 2016-09-08
@FFxSquall

Well, there are perhaps several options, for example, we just continue to write elements, or you can use full-fledged blocks (if necessary, also hang the element class), it depends on whether these blocks will be used not in the context of this block.
For example:

<div class="advantages__wrap clearfix">

  <div class="advantages__item">
    <div class=""advantages__preview">
      <img class="image" src="img/advantages/1.png" alt="image">
    </div>
    <div class=""advantages__text">
      <h3 class="title">Опыт работы</h3>
      <p class="text">Более 8 лет мы занимаемся архитектурной подсветкой зданий</p>
    </div>
  </div>
</div>

and maybe so
<div class="advantages__wrap clearfix">

  <div class="advantages__item">
    <div class=""advantages__preview">
      <img class="image advantages__img" src="img/advantages/1.png" alt="image">
    </div>
    <div class=""advantages__text">
      <h3 class="title advantages__title">Опыт работы</h3>
      <p class="text advantages__text">Более 8 лет мы занимаемся архитектурной подсветкой зданий</p>
    </div>
  </div>
</div>

PS In general, there are a lot of wonderful articles, after which a lot of questions will disappear and everything will fall into place by itself.
For example, here is one of them (about mistakes that are often made)
https://habrahabr.ru/post/305548/

A
Andrey Verkh, 2016-09-08
@sadisme

To the options that they wrote, I would add:

.advantages__item
.advantages__item-img
.advantages__item-text

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question