Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make inner div grow in height when outer div grows

Tags:

css

I have two divs inside a parent div (see image below). When the "black" div grows in height, so does the outer "red" div, but I want to make the "green" div to grow as well. How can this be done in css?

enter image description here

like image 841
King Julien Avatar asked Oct 08 '22 23:10

King Julien


1 Answers

You can use the CSS properties table, table-row, and table-cell. You may need to check if its supported in browsers your targeting though. http://www.quirksmode.org/css/display.html#table

Example: http://jsfiddle.net/2GawC/

like image 101
benni_mac_b Avatar answered Oct 13 '22 10:10

benni_mac_b