Each containing element must have a height set to 100% along with the element you want it to be 100%. This assumes that the target element (here the blue square div) is not located absolutely, and in this case you can simply set both its "upper" and "lower" values to zero.
source
share