M
M
Monty Python2018-06-14 20:20:33
css
Monty Python, 2018-06-14 20:20:33

What makes a tag with two block classes global and its own?

What is a "global" and "native" class, does it have to do with modifiers in any way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
boga-net, 2018-06-14
@Austin1

If I correctly understood the context of the classes in your question, then it turns out that

<div class="title title--color__red"></div>
<div class="title title--color__green"></div>
<div class="title title--color__black"></div>

// .title- глобальный класс. Можно задать общие стили для группы элементов, чтобы их не дублировать
.title {
       text-align: center;
       color: black;
       font-size: 16px;
}

// собственные классы. Дополнительные (индивидуальные) стили
.title .title--color__red {
       color: red;
}

.title .title--color__green {
       color: green;
       font-size: 14px; // Переопределили стиль глобального класса
}

.title .title--color__red {
       color: blue;
       text-decoration: underline;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question