This blog post explains how styles in angular2 override each other http://blog.thoughtram.io/angular/2015/06/25/styling-angular-2-components.html
Citation: โWhere do they end in the DOM? Well, for the same reason as explained earlier, they are written to the beginning of the document. But not only this, when Angular retrieves style resources, it takes a text response, builds the lines and adds them after all inline component styles. "
Inline Styles have the highest priority in Angular2
When working with <link rel="stylesheet" href="..."/> in the header, see this stream CSS file paths are not resolved correctly using Angular ng-view , fixed " / '
<link rel="stylesheet" href="/styles/main.css"/> instead of <link rel="stylesheet" href="styles/main.css"/>
There's a further explanation in this thread. Load external CSS style in Angular 2 Component
Three ways to insert CSS
Perhaps the easiest way is to insert the full path in css
.sample { background-image: url(/assets/plugins/test/img/bg.jpg); }
instead
.sample { background-image: url(../img/bg.jpg); }
ralf htp
source share