user319940
user319940

Reputation: 3317

100% height divs

I feel really stupid for not seeing whats wrong here.

Basically three divs in a row with a container - want all of them to be as high as the container.

Here's a reduced test case:

http://codepen.io/jgclifton/full/mDdpv

Any ideas?

Upvotes: 1

Views: 48

Answers (2)

Hachi
Hachi

Reputation: 173

Container has height: auto; If you change it to height: 100px; for exemple, every divs have same height to me.

Upvotes: 1

Bojangles
Bojangles

Reputation: 101533

Give div.container an explicit height, and your divs will line up perfectly. Currently, it has a height of auto, meaning that using height: 100% on the child elements has no effect. Setting a height of, say, 200px on the container gives the percentage-based height something to use as a reference.

Upvotes: 3

Related Questions