Raj
Raj

Reputation: 3061

How to define minimum height is equal to height of parent?

How can I define the minimum height of a element to equal to the height of its immediate parent and if it is more than that, it should expand to fit the content that it encloses?

Upvotes: 0

Views: 94

Answers (3)

Simo Mafuxwana
Simo Mafuxwana

Reputation: 3762

There is a much more simpler solution. If you think of it its the same as table td's expanding once and of the sibling content becomes 'bigger' than the rest. So we dnt want to use a table, we want to stick to the div's....

HTML: There must be a common class btwn your div's or in my example p tags and that class is equal

CSS: We 'import' the table > td property via css .equal {display:table-cell;}

giving us this in the end http://jsfiddle.net/simomultimedia/APLWp/

Love, Peace and Chicken Grease!

Upvotes: 0

Bobby5193
Bobby5193

Reputation: 1625

i think that if you have a min-height property set for the parent, then you could use

{ min-height:inherit; height:inherit; }

Upvotes: 1

gabitzish
gabitzish

Reputation: 9691

Set min-height : 100% to your element.

Upvotes: 1

Related Questions