title: How to extend divs height till the footer at the bottom
body: <p>I have troubles here I want that container color with linear gradient to go till the bottom to stick with the footer no matter does it have so much content for that Div container or not IF the sidebar has content more than the container and vice versa. Sidebar has no background color that color is from the parent wrapper Div. Also the footer I need to be sticked at the bottom after the content ends not to display empty spaces there.</p>
  
  <p><img src="https://i.stack.imgur.com/walUJ.jpg" alt="enter image description here"></p>
  
  <p>Here are my codes:</p>
  
  <p>CSS:</p>
  
  <pre><code>#pjesa-kryesore{ /*main wrapper */
      display:flex;
      max-width: 98%;
      margin:0px auto;
  } 
  
  
  /* Permbajtja (container) */
  #permbajtja{
      flex-grow:1;
      background:-webkit-linear-gradient linear-gradient(#fff,#bdbdbd);
      background:-o-linear-gradient linear-gradient(#fff,#bdbdbd);
      background:-moz-linear-gradient linear-gradient(#fff,#bdbdbd);
      background:linear-gradient(#fff,#bdbdbd);
  
      font-family: Open Sans;
      padding:30px;
  
  }
  
  
  /* Sidebar */
  #sidebar-majtas{
      width:350px;
      flex-shrink:0;
  }
  
  .menu{
      background:-webkit-linear-gradient linear-gradient(#5b91e9,#a0c3fb);
      background:-o-linear-gradient linear-gradient(#5b91e9,#a0c3fb);
      background:-moz-linear-gradient linear-gradient(#5b91e9,#a0c3fb);
      background:linear-gradient(#5b91e9,#a0c3fb);
  
      border-radius: 15px;
      text-align: center;
      font-family: Open Sans;
      margin: -45px auto 15px auto;
      padding: 20px 5px;
      width: 270px;
  }
  
  .menu-btn{
      text-decoration: none;
      color:#fff;
      display: block;
  }
  
  .menu-btn:hover{
      color:#555;
  }
  
  
  /* Footeri */
  #footer{
      position:absolute;
      left:0px;
      bottom:0px;
  }
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div id="pjesa-kryesore"&gt;
          &lt;div id="sidebar-majtas"&gt;
              &lt;div class="menu"&gt;
                  &lt;a href="index.html" class="menu-btn padding"&gt;Ballina
                  &lt;br&gt;&lt;span style="font-size:12px"&gt; Informacionet ...&lt;/span&gt;
                  &lt;/a&gt;
                  &lt;a href="#" class="menu-btn padding"&gt;Link 2
                  &lt;br&gt;&lt;span style="font-size:12px"&gt; Informacionet ...&lt;/span&gt;&lt;/a&gt;
                  &lt;a href="#" class="menu-btn padding"&gt;Link 3
                  &lt;br&gt;&lt;span style="font-size:12px"&gt; Informacionet ...&lt;/span&gt;&lt;/a&gt;
              &lt;/div&gt;
              &lt;/div&gt;    
          &lt;div id="permbajtja"&gt;
              Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean gravida, quam non consequat blandit, ligula elit dignissim sapien, et luctus eros arcu et purus. Donec efficitur mi in mi luctus gravida. Suspendisse magna eros, mollis at lobortis sollicitudin, pharetra ac arcu. Cras vitae dignissim nunc. Aliquam eu felis ut neque placerat accumsan vitae at lorem. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Integer pellentesque venenatis hendrerit. Sed pretium eleifend lorem nec maximus.
  
  Morbi commodo lectus a nulla varius faucibus. Morbi id turpis sed odio pretium tincidunt. Nullam a elit id turpis commodo interdum at a nunc. Nam imperdiet dictum tortor. Pellentesque eu molestie tortor. Vivamus sit amet dolor posuere, tristique libero id, aliquam dui. Aliquam elit nulla, pellentesque quis magna eu, imperdiet lobortis nibh. Donec et egestas ante, eget porttitor nisi. Integer porttitor luctus justo.
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div id="footer"&gt;(C) Copyrighr...&lt;/div&gt;
  </code></pre>
  
  <p>UPDATE: (Media screen query)</p>
  
  <pre><code>@media all and (max-width: 800px) {
  
      #pjesa-kryesore {
          flex-flow:column;
      }
  
      /* Make the sidebar take the entire width of the screen */
  
      #sidebar-majtas {
          width:auto;
      }
  
  }
  </code></pre>