Answer the question
In order to leave comments, you need to log in
What is the correct name for a nested block in BEM?
<div class="c-card">
<div class="c-card__header">
<h2 class="c-card__title">Название</h2>
</div>
</div>
<div class="c-card">
<div class="c-card__header">
<h2 class="c-card__title">Заголовок</h2>
</div>
<div class="c-card__foter">
<h2 class="c-card__title">Заголовок</h2>
</div>
</div>
<div class="c-card">
<div class="c-card__header">
<h2 class="c-card__header-title">
Заголовок</h2>
</div>
<div class="c-card__footer">
<h2 class="c-card__footer-title">
Заголовок</h2>
</div>
</div>
<div class="c-card">
<div class="c-card-header">
<h2 class="c-card-header__title">
Заголовок</h2>
</div>
<div class="c-card-footer">
<h2 class="c-card-footer__title">
Заголовок</h2>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
You can leave as in the first option.
Simply styles will be defined like this:
// Если есть общие
.c-card__title {}
// Ну и при каких-либо отличиях
.c-card__header .c-card__title {}
.c-card__footer .c-card__title {}
.c-card__title
add a modifier for it, .c-card__title--header
or .c-card__title--footer
hang styles on it. <div class="c-card">
<div class="c-card__header">
<h2 class="c-card__title c-card__title--header">Заголовок</h2>
</div>
<div class="c-card__footer">
<h2 class="c-card__title c-card__footer">Заголовок</h2>
</div>
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question