In my css, I have the height of the parent set to 75px, and the height of the child set to 100%, and it displays correctly. However, when I change the parent's height attribute to a min-height of 75px instead, the child shrinks to the height of the text it contains, but the parent's height stays 75px. Why doesn't the child stay 75px?
#parent{
height:75px;
background-color:navy;
clear:left;
}
#child{
width:300px;
height:100%;
background-color:aqua;
float:left;
}
Here, the child is 75px like it is supposed to be.
#parent{
min-height:75px;
background-color:navy;
clear:left;
}
#child{
width:300px;
height:100%;
background-color:aqua;
float:left;
}
The child is only 21px high now.