A
A
Anastasia Dementieva2017-04-18 13:53:04
HTML
Anastasia Dementieva, 2017-04-18 13:53:04

How to style paragraphs and headings according to BEM?

Is it possible to assign classes to h1-h6 and p headings according to BEM? Or is it better to wrap it in a div, and style the class div p / class div h1, what will happen when the layout is pulled on cms

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Tokmakov, 2017-04-18
@NPC

Actually, everyone is stupid <p>, etc. add classes in the main content. Let's take, for example, the same site of BEM itself, their main content is wrapped in a block articleand styles are written

.article p {}
.article ul {}
и т.д.

Also on Habré - a class is added to the .html_formatblock with content and styles are also written through it, so I think there is nothing shameful in this and I do it in the same way

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question