Answer the question
In order to leave comments, you need to log in
Is it possible to set the height of a flexbox container as a percentage?
I need to fit a div into a flex-box container so that it takes up 90% of the height. Everything is fine with the width, but the width cannot be set as a percentage. You can only fixed in pixels.
.LeftContainerTop
{
border: 1px solid green;
flex-grow: 0.4;
display: flex;
align-items: center;
justify-content: center;
}
.SliderInContainerOnMainPage
{
border: 1px solid red;
flex-grow: 1;
// вот тут
}
Answer the question
In order to leave comments, you need to log in
The code should be at the end of the page, or loaded after all html elements are loaded. res.onkeypress
will be null
because the click event you set forinp
An element can only be stretched x% height from its parent if you give the parent a clear height
https://jsfiddle.net/ceb6hrdL/2/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question