title: CSS If div's height is greater than 100vh, then add margin-bottom to div
body: <p>I want to add <code>margin-bottom: 40px;</code> to a div if the height of the div is greater than the maximum view height (100vh). Is it possible to do this with css?</p>
  <p>This is my code:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.container {
    height: 100vh;
  }
  
  .body {
    background-color: yellow;
  }
  
  .foot {
    position: fixed;
    bottom: 0;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
  
    I want user to be able to scroll and view all p elements in the body, however they should not overlap the footer. So I want to give bottom margin to the body class if it's height is greater than 100vh.
  
    &lt;div class="body"&gt;
      &lt;p&gt;The number of this element is variable&lt;/p&gt;
      &lt;p&gt;The number of this element is variable&lt;/p&gt;
      &lt;p&gt;The number of this element is variable&lt;/p&gt;
      &lt;p&gt;The number of this element is variable&lt;/p&gt;
      &lt;p&gt;The number of this element is variable&lt;/p&gt;
      &lt;p&gt;The number of this element is variable&lt;/p&gt;
      &lt;p&gt;The number of this element is variable&lt;/p&gt;
      &lt;p&gt;The number of this element is variable&lt;/p&gt;
      &lt;p&gt;The number of this element is variable&lt;/p&gt;
      &lt;p&gt;The number of this element is variable&lt;/p&gt;
      &lt;p&gt;The number of this element is variable&lt;/p&gt;
    &lt;/div&gt;
  
    &lt;div class="foot"&gt;
      &lt;p&gt;THIS SHOULD ALWAYS BE DISPLAYED AT THE BOTTOM&lt;/p&gt;
    &lt;/div&gt;
  
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>