html - Position div atop its parent -
i want position child div above parent following image shows:
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
Post a Comment