Trival case is working
HTML
<div class="container">
<div class="element">
Content
</div>
</div>
CSS
body, html{
height:100%;
}
.container{
background: green;
height: 100%;
}
.element{
background: gray;
height:100%;
width:100px;
}
Gray element has same height as his green parent
Here is my "minimal working sample"
HTML
<div id="wrapper">
<div id="header">
Header
</div>
<div id="content">
<div class="text-background">
Some content text
</div>
</div>
<div id="footer">
Footer
</div>
</div>
CSS
html, body {
font-family: Arial, Helvetica, sans-serif;
background: black;
color: #FFF;
padding: 0;
margin: 0;
height: 100%;
}
#wrapper {
min-height: 100%;
position: relative;
}
#content {
min-height: 100%;
padding-bottom: 172px; /* Height of the footer element */
background: green;
}
#footer {
border-top: 2px #999 solid;
background-color: #FFF;
padding: 15px 0;
width: 100%;
height: 140px;
position: absolute;
bottom: 0;
left: 0;
color:black;
}
#header{
border-bottom: 1px solid white;
}
.text-background {
background: gray;
height: 100%;
min-height: 100%;
width:100px;
}
Why gray div doesnt fill its green parent by height?