title: how to make parent height relevant to children but also don't increase parent height when children height increases
body: <p>As the title describes i have a parent div which contains children divs.</p>
  
  <p>I can't know how many children there will be so i can't give a fixed height to the parent.</p>
  
  <p>The height of the children divs increases on hover.</p>
  
  <p>How can i make the parents height be relevant to it's children but also don't increase when their height increases?</p>
  
  <p>As you can see in the code "parent2" has the desired functionality but it's height is fixed which i can't use.</p>
  
  <p>PS without using javascript</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;div class="parent"&gt;
    &lt;div class="child"&gt;&lt;/div&gt;
    &lt;div class="child"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="parent2"&gt;
    &lt;div class="child"&gt;&lt;/div&gt;
    &lt;div class="child"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>CSS</p>
  
  <pre><code>.parent,
  .parent2{
    display: inline-block;
    width: 200px;
    overflow: hidden;
  }
  
  .parent {
    height: auto;
    background-color: green;
    vertical-align: top;
  }
  
  .parent2 {
    height: 300px;
    background-color: steelblue;
    margin-left: 50px;
  }
  
  .child {
    height: 100px;
    width: 100px;
    background-color: orange;
    margin: 10px auto 10px auto;
    transition: height 0.5s ease;
  }
  
  .child:hover {
    height: 150px;
  }
  </code></pre>
  
  <p>My fiddle: <a href="https://jsfiddle.net/zuswrt23/" rel="nofollow noreferrer">https://jsfiddle.net/zuswrt23/</a></p>