title: Setting simple div to have size height and width 50% of body?
body: <p>I am trying to achieve that the width of the div is always 50% of the body. E.g. when I resize the window, the div should become smaller.</p>
  
  <p>But the div size applied does not work at all when % is used.
  <a href="http://codepen.io/anon/pen/yJbFD" rel="nofollow">See here</a></p>
  
  <p>What I don't want to do is to be forced to specify a width of body. Since that is exactly, that should be variable</p>
  
  <p>CSS</p>
  
  <pre><code>.someclass{
    width: 50%;
    height: 50%;
    background-color: #444444;
  }
  
  
  
  body {
      background-color: cyan;
  }
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;div class="someclass"&gt; &lt;/div&gt;
  </code></pre>