How to prevent overflow in responsive design?

@AbdiViklas I posted a very similar question when I started the JavaScript Calculator.
If you design your main div so it is 320px wide, then it will fit on mobile. Then keep checking the height to make sure it’s not too long. I think that should help you.
Here is my previous question:

Also, to specifically address your question instead of over-all responsive design, maybe:

overflow: hidden;

is what you are looking for?