title: Why does my accordion move up when i click on it
body: <p><a href="https://i.stack.imgur.com/HLVWc.png" rel="nofollow noreferrer">when the accordion are opened the div moves up</a></p>
  <p>When the page loads, everything looks fine and perfectly placed, but when the accordions are clicked, the div containing the accordion and images moves up.</p>
  <p>Here is my web <a href="https://gracious-euclid-6b6204.netlify.app/" rel="nofollow noreferrer">https://gracious-euclid-6b6204.netlify.app/</a></p>
  <p>EDIT :
  I found out that the problem is with &quot;Overflow : hidden&quot; on the container that is causing the div to move up but if I do not use Overflow Hidden, my image will overflow what to do?</p>
  <p>Thanks in advance for your kind help</p>
  <pre><code>.accordion {
    width: 57%;
    height: 100%;
    padding: 5.5rem;
  }
  
  .accordion h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 3rem;
  }
  
  .accordion-item {
    /* display: flex; */
    margin-bottom: 2rem;
    border-bottom: 2px solid hsl(240, 5%, 91%);
  }
  
  .accordion-link {
    font-size: 1.5rem;
    color: hsl(237, 12%, 33%);
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
  }
  
  .accordion-link img {
    height: 100%;
  }
  
  .answer {
    font-size: 1.4rem;
    color: hsl(240, 6%, 50%);
    margin-bottom: 1rem;
    /* display: none; */
    max-height: 0rem;
    overflow: hidden;
    transition: max-height 200ms;
  }
  
  .accordion-link:hover {
    color: hsl(14, 88%, 65%);
  }
  
  .accordion-item:target .answer {
    max-height: 20rem;
  }
  
  .accordion-item:target .accordion-link {
    color: hsl(238, 29%, 16%);
    font-weight: 700;
  }
  
  .accordion-item:target .accordion-link img {
    transform: rotate(180deg);
  }
  </code></pre>