title: CSS - vh does work while percentage doesn't
body: <p>For a project I started making a template containing a banner (80% of the page).</p>
  
  <p>Yesterday I had a problem with using <code>%</code>. <code>%</code> wasn't working for me while <code>vh</code> did. The problem, someone said, was that the div where I had put the background was also in a div but without a height. So I defined that to <code>100%</code>. But still it doesn't work. The <code>background-image</code> is just as big as the content of the div itself.</p>
  
  <p>My codes:</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>@charset "utf-8";
  /* CSS Document */
  /*MAIN*/
  body{
   width: 100%;
   height: 100%;
  }
  /*BANNER*/
  #banner{
   width: 100%;
   height: 100%;
   background-color: black;
  }
  #bannerimg{
   background-image: url("https://www.gettyimages.ie/gi-resources/images/Homepage/Hero/UK/CMS_Creative_164657191_Kingfisher.jpg");
   background-repeat: no-repeat;
   background-attachment: fixed;
   background-position: center;
   height: 80%;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
   &lt;head&gt;
    &lt;!--ALGEMEEN--&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;title&gt;Homepagina - RC paneel&lt;/title&gt;
    &lt;!--FONT--&gt;
    &lt;!--INCLUDE--&gt;
    &lt;link href="//cdn.muicss.com/mui-0.9.41/css/mui.min.css" rel="stylesheet" type="text/css" /&gt;
    &lt;script src="//cdn.muicss.com/mui-0.9.41/js/mui.min.js"&gt;&lt;/script&gt;
    &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"&gt;
    &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"&gt;&lt;/script&gt;
    &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"&gt;&lt;/script&gt;
    &lt;!--STYLE--&gt;
    &lt;link rel="stylesheet" href="css/index.css"&gt;
    &lt;!--SCRIPT--&gt;
   &lt;/head&gt;
   &lt;body&gt;
    &lt;!--BANNER--&gt;
    &lt;section id="banner"&gt;
     &lt;!--NAVBAR--&gt;
     &lt;!--BANNER--&gt;
     &lt;div id="bannerimg"&gt;
      Test
     &lt;/div&gt;
    &lt;/section&gt;
    &lt;!--OVER ONS--&gt;
    &lt;!--VEELGESTELDE VRAGEN--&gt;
    &lt;!--CONTACT--&gt;
   &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>