A footer at the end of the content page

I’m trying to achieve something in my app: having a footer that doesn’t stick but ends at the end of the page, permitting to scroll if it would hide content or place itself at the end of the view port.

Every solution or options I tried didn’t work, it either hides the content or doesn’t go at the end of the content.

Even tried with ion-footer-bar… Don’t know how to do it with that tho, it has weird behavior.

What I DON’T want (footer overlapping content)

What I want (screen not large enough for both, scrolls for showing footer)

What I want again (screen large enough to display both content and footer)

What I DON’T want (huge blank space at the end of the view port, footer should go at the more end of it it could)

Thanks for helping.

Any suggestion please?