Hi i am having trouble trying to get my child div expand to the height of the parent div that it is inside of.
Here is the css for the parent div
#wrapper #content {
border: 1px ridge #999;
height: auto;
min-height: 1000px;
width: 1100px;
margin-top: 40px;
margin-right: auto;
margin-bottom: 30px;
margin-left: auto;
float: left;
}
And here is the css for the child div
.tab_container {
clear: both;
width: 100%;
border-right: 1px ridge #999;
margin-bottom: 20px;
height: 100%;
}
Any ideas what i can do?
You can do it with the folowing style: (Inspired by this question: CSS - Expand float child DIV height to parent's height)
#content {
border: 1px ridge #999;
height: auto;
min-height: 1000px;
width: 1100px;
margin-top: 40px;
margin-right: auto;
margin-bottom: 30px;
margin-left: auto;
float: left;
position: relative; /* added */
width: 100%; /* added */
}
.tab_container {
border: 1px ridge orange; /* added */
clear: both;
width: 100%;
border-right: 1px ridge #999;
margin-bottom: 20px;
height: 100%;
position: absolute; /* added */
}
Fiddle here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With