I am facing some problems to add style to my angular 2 component using styleUrls.
Here is how I use it:
path /main.component.ts
@Component({
selector: 'app-view',
styleUrls: ['./styles/style.css'],
template:
})
path / styles / style.css
.main-wrapper {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
background: red; }
And nothing happens in my browser. I tried with:
- absolute path
- path relative to the root component.
I also tried:
- to write this using different type syntaxes
'./styles/style.css','styles/style.css' - to move mine
style.cssnext to my component.
But I canβt make it work.
source
share