title: Center elements inside SVG relative to each other-
body: <p>Couldn't find it anywhere else to I might ask here : </p>
  
  <p>I have svg rectangle which inside has other rectangles.</p>
  
  <p>What I want to achieve is to center each of these rectangles in the centre of it's parent and in relation to each other.</p>
  
  <p>If I drag rectangle 1 down I want the other one to move up to keep both of them centered - and same thing happening if I drag the other element down (should push upper one up). </p>
  
  <p>Problem here is that I might have different width/heights and there would be 2 or more elements. Is there any mathematical equationfor that? Or a name that I can look for?</p>
  
  <p><a href="https://i.stack.imgur.com/ND3aw.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ND3aw.jpg" alt="enter image description here"></a></p>