title: Avoid that keyframe animation overflows submenus in navigation
body: <p>I have the following <code>HTML</code> and <code>CSS</code> which you can also find in the JSfiddle <a href="https://jsfiddle.net/vu0hnqab/129/" rel="nofollow noreferrer">here</a>:</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>/* Header &amp; Naviagtion */
  
  .header {
    width: 100%;
    height: 10%;
    position: fixed;
  }
  
  .navigation {
    width: 100%;
    height: 100%;
  }
  
  .navigation&gt;ul {
    height: 100%;
    width: 100%;
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: purple;
  }
  
  .panel {
    transform: scale(1, 0);
    transform-origin: top;
    transition-duration: 0.2s;
    width: 100%;
    position: absolute;
    top: 100%;
    background-color: lime;
  }
  
  .button:hover .panel {
    transform: scale(1);
  }
  
  
  
  /* Content Animation */
  
  .parent{
   margin-top: 5%;
   height: 10%;
   width: 100%;
   float: left;
   position: relative;
  }
   
  .content1{
   height: 100%;
   width: 100%;
   background-color: blue;
   float: left;
   position: absolute;
  }
   
   .content2{
   height: 100%;
   width: 100%;
   background-color: red;
   float: left;
   animation-delay: 1s;
    position: absolute;
  }
   
   .content3{ 
   height: 100%;
   width: 100%;
   background-color:yellow;
   float: left;
   animation-delay: 2s;
   position: absolute;
  }
   
  .content4{
   height: 100%;
   width: 100%; 
   background-color: green;
   float: left;
   animation-delay: 3s;
   position: absolute;
  }
   
  .content5{
   height: 100%;
   width: 100%;
   background-color: lime;
   float: left;
   animation-delay: 4s;
  }
  
  
  .parent div {
   animation-name: animation_01;
   animation-duration:5s;
   animation-iteration-count:infinite;
   animation-fill-mode: forwards;
   opacity:0;
   }
  
  @keyframes animation_01 {
    12.5% {
      opacity: 1
    }
    0%, 25%, 100% {
      opacity: 0
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="header"&gt; 
    &lt;nav class="navigation"&gt; 
      &lt;ul&gt;
      &lt;li class="button"&gt; 1.0 Main Menu 
        &lt;ul class="panel"&gt;
          &lt;li&gt; 1.1 Sub Menu &lt;/li&gt;
          &lt;li&gt; 1.2 Sub Menu &lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/nav&gt;     
  &lt;/div&gt; 
  
  
  &lt;div class="parent"&gt;
   &lt;div class="content1"&gt;Here goes content1&lt;/div&gt;
   &lt;div class="content2"&gt;Here goes content2&lt;/div&gt;
   &lt;div class="content3"&gt;Here goes content3&lt;/div&gt;
   &lt;div class="content4"&gt;Here goes content4&lt;/div&gt;
   &lt;div class="content5"&gt;Here goes content5&lt;/div&gt;
   &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>As you can see in the comments the code is divided in two parts:</p>
  
  <p><strong>Part 1:</strong> <code>Navigation</code> with a <code>panel</code> to display submenus when the <code>button</code> is hovered. <br>
  <strong>Part 2:</strong> An automated <code>animation</code> of a <code>content</code> using CSS <code>keyframes</code>.</p>
  
  <p>Both parts individually work fine.</p>
  
  <hr>
  
  <p>Now my issue is that the <code>animation</code> of the content overflows the <code>panel</code> of the <code>navigation</code> which results from the <code>absolute</code> position of the <code>animation</code>. However, I need this <code>absolute</code> position to make the animation work since I want to have <code>content1</code> til <code>content5</code> displayed on top of each other.</p>
  
  <p>On the other side I also want to have <code>navigation</code> that is not overflown by the <code>animation</code>.</p>
  
  <p>Do you have any idea how I can solve this dilemma?</p>