This sounds like the kind of inheritance in Object-Oriented programming, if I understand you correctly. In CSS a child can inherit from a parent and sometimes farther back just like in a family tree. However sometimes you may have to specify inherit: mostly it just happens. For example:
body {
background-color: white;
color: black;
}
can set that style throughout the document. Unless it is overwritten later for a particular section. Images are just “inline” elements like span and don’t have a parent-child relationship.
There are some rules for inheritance, but broadly speaking the children element will inherit from the parent element.
And then using a CSS Preprocessor like SCSS you can do nesting. There are also functions and mixin/include which lets you bring in functionality/CSS you can then use in other style blocks.