Answer the question
In order to leave comments, you need to log in
Block height to full screen?
Hello.
The task is this. The maximum screen height is 100%. those. The scrollbar should not appear in any case. There is a fixed height header and footer. They are located respectively at the top and bottom of the screen. You need to add a block between them so that its height completely occupies the free space between the header and footer, regardless of the content. All this needs to be done without using js.
Answer the question
In order to leave comments, you need to log in
<div id="wrap">
<header></header>
<main></main>
<footer></footer>
</div>
html, body {margin: 0}
#wrap {
border: 2px solid #000;
display: flex;
flex-flow: column nowrap;
width: 100vw;
height: 100vh;
}
header {
flex: 0 0 100px;
background: green;
}
footer {
flex: 0 0 150px;
background: blue;
}
main {
flex: 1 1 auto;
background: yellow;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question