I need some help with footer placement for mobile devices in a web page. Currently, I have a fixed footer at the bottom of the HTML page. However, when I try to focus on an input box in mobile, the keyboard opens and the footer gets hidden under the keyboard. How do I make sure that the footer always gets placed above the keyboard and not under it? Here is the CSS I currently have.
.footer {
position: fixed;
right: 0;
bottom: 0;
left: 0;
z-index: 999;
white-space: nowrap;
width: 100%;
color: black;
background-color: white;
border-top: 2px solid green;
padding-top: 6px;
padding-bottom: 6px;
padding-right: 5px;
height: 20px;
overflow-x: scroll;
overflow-y: hidden;
}
<!--Footer needs to be over the keyboard in mobile devices when the input gains focus-->
<input type="text" placeholder="Footer over Keyboard">
<div class="footer">
<button>Button 1</button>
<button>Button 2</button>
<button>Button 3</button>
</div>
NOTE(EDIT): How to prevent mobile keyboard from rising footer over the text fields? is not my question. That question is the exact opposite of my question and provides no answers or insight into how my problem can be solved.