I have a header
a main
and a footer
. The the header and the foter have fixed heights. The main
has a min-height of 100% - 250px(header + footer). I want to extend the div id="content"
inside the main to the full height of the main. Why isn't it working?
html {
height: 100%;
box-sizing: border-box;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
body {
background-color: #f5f5f5;
margin: 0;
padding: 0;
position: relative;
height: 100%;
}
header {
background-color: #131b23;
border-bottom: 6px solid #0f151a;
text-align: center;
left: 0;
top: 0;
width: 100%;
height: 170px;
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
z-index: 99;
}
main {
text-align: center;
min-height: calc(100% - 250px);
/* Header 170px + Footer 80px = 250px */
background-color: blue;
}
#content {
width: 65%;
margin-left: auto;
margin-right: auto;
background-color: red;
min-height: 100%;
}
footer {
background-color: #131b23;
border-top: 6px solid #0f151a;
text-align: center;
height: 80px;
z-index: 98;
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
width: 100%;
}
<header>
</header>
<main>
<div id="content">
Text 123
</div>
</main>
<footer>
</footer>