Answer the question
In order to leave comments, you need to log in
Making navigation according to the BEM methodology?
Let's say I have the following navigation structure:
<nav class="menu">
<a class="menu__item" href="#!">
<i class="menu__icon"></i>
Main
</a>
</nav>
.menu__item {
padding: 1rem 2rem;
}
.menu__icon {
margin-right: 0.5rem;
}
<nav class="menu">
<ul class="menu-list">
<li class="menu-list__item">
<a class="link" href="#!">
<i class="link__icon"></i>
Main
</a>
</li>
</ul>
</nav>
// По-умолчанию
.link {
text-decoration: underline;
}
// В контексте меню_айтема.
.menu-list__item .link {
padding: 1rem 2rem;
text-decoration: none;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question