Answer the question
In order to leave comments, you need to log in
How to use flexbox in angular2?
Good afternoon. I want to use flexbox in an angular2 project. I have a top toolbar on the page, below the navbar, even below the router-outlet itself, with which I want it to stretch to its full height, more precisely, have the flex: 1 property, which will allow it to stretch to the rest of the space. Angular2 generates this DOM
<my-app>
<sd-toolbar> </sd-toolbar>
<sd-navbar></sd-navbar>
<router-outlet></router-outlet>
<sd-home></sd-home>
</my-app>
flex-direction: column;
, sd-toolbar and sd-navbar have a fixed height, but sd-home does not want to fill all the remaining space. Or should flex:1 be set for router-outlet? Answer the question
In order to leave comments, you need to log in
So why is flex in body and not in my-app??
my-app {
display: flex;
flex-direction: column;
}
html {
min-height: 100%;
height: 100%;
}
body {
min-height: 100%;
height: 100%;
padding: 0;
}
my-app {
height: 100%;
margin: 0;
padding: 0 15px;
display: -webkit-flex;
display: flex;
flex-direction: column;
flex: auto;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question