Answer the question
In order to leave comments, you need to log in
Why do AppComponent styles propagate to \ other components?
AppComponent (HTML)
<header>
<div class="router">
<router-outlet></router-outlet>
</div>
</header>
header {
text-align: justify;
letter-spacing: 1px;
height: 8em;
padding: 2em 10%;
background: deepskyblue;
color: black;
}
Answer the question
In order to leave comments, you need to log in
color is an inherited property. In this example, div.router is a child element, so it gets the computed value of this property from its parent (header).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question