Answer the question
In order to leave comments, you need to log in
In a nutshell, what is BEM?
In a nutshell, in human language, I ask you to tell me about BEM. I didn't find much on the internet.
As I understand it, this applies to the frontend? Or am I wrong?
In general, the following questions are of interest:
1. Why is it needed?
2. Where is it applied?
3. Is it necessary for a layout designer to know it?
Answer the question
In order to leave comments, you need to log in
BEM is such a layout methodology from Yandex. It involves splitting pages into separate semantic blocks (comment, post, title, footer, form, input, etc.). Each block can be made up of other blocks. The main idea is to increase the reusability of already written blocks as much as possible, for which modifiers are used. Plus, BEM means avoiding cascading styles because they prevent reuse.
For example, there are two different headings on a page (for example, separately in the article, and separately in the sidebar). How is everyone used to doing it? there is a heading code:
And we put these headings in the text of the article and in the sidebars:
<article class="article">
<h1 class="header">Заголовок</h1>
<p>Текст текст текст</p>
</article>
<aside class="incut">
<h1 class="header">Заголовок</h1>
<p>Текст текст текст</p>
</aside>
.header {font-size: 2em; padding-bottom: 1.5em;}
.incut .header {text-decoration: italic;}
<article class="b-article">
<h1 class="b-article__header">Заголовок</h1>
<p>Текст текст текст</p>
</article>
<aside class="b-article b-article__incut">
<h1 class="b-article__header b-article__header_incut">Заголовок</h1>
<p>Текст текст текст</p>
</aside>
.b-article__header {font-size: 2em; padding-bottom: 1.5em;}
.b-article__header_incut {text-decoration: italic;}
It's just a contextless layout and a carriage
of pathos))) In fact, there are enough Modifier Elements:
.menu,
.menu-list{
position:relative;
}
.menu-list{
overflow:hidden;
margin:0 -10px;
}
.menu-item,
.menu-item-current{
display:block;
float:left;
margin:0 10px;
}
.menu-item{
color:#000;
}
.menu-item-current{
color:#f00;
}
In a nutshell: a block on the page (and in the code on the server), which can include the same (and similar) blocks with any level of nesting, using a single data manipulation structure.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question