title: How to calculate height in CSS
body: <p>I want to create a placeholder with CSS if an image is not present. There are 4 images in a row on a mobile device. The width is easy:</p>
  
  <pre><code>.placeholder {
  background: red;
  display: block;
  float: left;
  margin: 0px 1px 0px 0px;
  width: calc(100%/4 - 1px);
  height: 80px;
  }
  </code></pre>
  
  <p>I know that the images are 1.25 aspect ratio. So it should be possible to calculate the height. If one uses the same command like for width, the hight will be used as base for the 100% and not the width.</p>
  
  <p>Is there a solution with CSS for this problem?</p>