Как я уже сказал в комментарии, я считаю, что вы были правы: наследование в CSS связано с иерархией DOM. Некоторые стили наследуются от родительских элементов.
Специфичность связана с тем, какие правила CSS имеют приоритет над другими правилами CSS. Ниже приведены некоторые примеры.
.container {
font-size: 35px;
}
p {
color: red;
}
.section {
color: green;
}
div.section {
/* More specific then .section rule */
color: purple;
}
<div class="container">
<p>
Example of inheritance. This paragraph has inherited the font-size of its parent.
<span>This span also inherited font-size.</span>
</p>
</div>
<div>
<p class="section">
Example of specificity. The "section" class is more specific than the rule created for the p element. Therefore, styles defioned in the "section" class rule may override those defined in the p element rule.
</p>
<p>
No class applied.
</p>
<div class="section">
The "div.section" rule is more specific than the ".section" rule, so this text is purple.
</div>
</div>