A
A
Angularity2017-03-09 21:20:38
css
Angularity, 2017-03-09 21:20:38

Why do AppComponent styles propagate to \ other components?

AppComponent (HTML)

<header>
    <div class="router">
        <router-outlet></router-outlet>
    </div>
</header>

`
AppComponent (CSS)
header {
    text-align: justify;
    letter-spacing: 1px;
    height: 8em;
    padding: 2em 10%;
    background: deepskyblue;
    color: black;
}

Why does the h1 tag get "color: black" in another component?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolai Bolotnikov, 2017-04-13
@Jokernix

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 question

Ask a Question

731 491 924 answers to any question