html - Position div atop its parent -


i want position child div above parent following image shows:

child , parent

the child has no fixed height.

relevant code:

<footer id="parent">     <div id="child" v-if="composing">         <img src="/img/typing-indicator.gif" alt="typing" />         <span>user typing...</span>     </div>     <div id="input-container">          .....     </div>     </footer> 

give position: relative parent , position: absolute; & bottom: 100% child

.parent {    position: relative;    background: pink;    margin-top: 20px  }    .child {    position: absolute;    bottom: 100%;    left: 0;    right: 0;    background: yellow;  }
<div>    <footer class="parent">      parent      <div class="child" v-if="composing">          child      </div>     </footer>  </div>


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -