title: Positioning rotated square
body: <p>I need to position the three squares <a href="https://i.stack.imgur.com/I87ke.png" rel="nofollow noreferrer">Pythagoras' Theorem picture</a> to create a right angle triangle in the middle and need them to stay in this arrangement at all times resizing browser) without overlapping or moving apart. Right now I am using position:fixed for each square and placing them using percentages. </p>
  
  <p>Is there a better way to do this? 
  Thanks</p>
  
  <p>For the 5x5 squares im using</p>
  
  <pre><code>#five div {
  position:relative;
  height: 54px;
  width: 54px;
  border: 1px dashed gray;
  display: inline-block;
  margin: 0;
  }
  
  #five {
  width:300px;
  height:300px;
  background:yellow;
  border:5px solid yellow;
  margin:auto;
  transform: rotate(30deg);
  padding: 5px;
  position: fixed;
  top:20%;
  left: 50%;
  }
  </code></pre>
  
  <p>3x3 dark blue square</p>
  
  <pre><code>#three {
  width: 150px;
  height: 150px;
  border: 5px solid blue;
  padding: 5px;
  position: fixed;
  top:48%;
  left: 33%;
  }
  </code></pre>
  
  <p>4x4 lightblue square</p>
  
  <pre><code>#four {
  width: 260px;
  height: 260px;
  border: 5px solid lightblue;
  margin-top: 5px;
  padding: 5px;
  position: fixed;
  top:69%;
  left: 45%;
  </code></pre>