I have a problem with the position of divs relative to another div.
I want to make a div that is in the horizontal middle of the screen, and in this div I want to place 3 other divs with the same height. But they all must respond.
There are more words in the picture :)

<div id="zwrapper"> <div id="z1" class="row"></div> <div id="z2" class="row"></div> <div id="z3" class="row"></div> </div>
The blu element is HTML
html{ background: steelblue; height: 100%; width: 100%; top:0; left:0; bottom: 0; right:0; }
One lime is that div (#zwrapper) , where I want to add three red divs.
#zwrapper{ height: 81%; top: 10%; width: 100%; left: 0; position: absolute; background: lime; }
Red divs create problems. All divs are 30% high. The first should be aligned at the top, and the third at the bottom. The middle div with id #z2 is the only one that has a margin of 5% .
.row{ position: relative; width: 80%; background: red; height: 30%; } #z2{ margin: 5% 0; }
My idea was to put 3 divs with a height of 30% in a wrapper and give the middle margin (top / bottom) 5% to get a height of 100%. But that does not work.
If I resize the window in width, the height of the red divs changes, although I do not change the height.
I am doing a violin to demonstrate this. http://jsfiddle.net/ELPJM/
Thanks in advance
source share