Change / add styles from div .principal
to:
.principal{
height: 100%;
min-height: 400px;
position: relative;
}
And of div
of buttons:
div.footer-buttons{
bottom: 0;
}
And put div
of the buttons ( div.footer-buttons
) at the end of div .principal
, since the buttons are only links and do not use form
.
What will these changes do?
You will set a minimum height in the div .principal
of 400px
and the buttons will always be in bottom
of div
, so that when the keyboard appears and the screen becomes smaller than 400px
height, buttons will not go up.
Alternative way via jQuery:
With this method you will not need to make the CSS changes above. The code will hide the buttons if the screen is too short to fit them (when you open the keyboard on the device, much of the height of the screen is occupied by the keyboard) and will show them again when there is space (when closing the keyboard) . Just add the code:
<script>
$(window).on("resize", function(){
if(window.innerHeight < $("a.btn.btn-success.btn-lg.green-button").offset().top+120){
$("div.footer-buttons").hide();
}else{
$("div.footer-buttons").show();
}
});
</script>