The green outer DIV is positioned (to establish a new positioning context) and its size depends on the inner DIV:

Red inner DIV
position: relative
top: +50%
left: +50%