I am using Angular2 and I want to set the height of <app-root>
to 100% of <body>
.
Currently I have:
<body>
<app-root></app-root>
</body>
and in CSS file I've set:
app-root {
height: 100%;
}
but it seems nothing changed.
Do you have any idea?
In the component css use the :host selector
:host {
height: 100%
}
Just set display
property to block
:
app-root {
display: block;
height: 100%;
}
All custom elements are created as inline
so you cannot manipulate their dimensions. You need to make them block elements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With