I usually use a Frame with
UDim2.new(1, 0, 1, 0)
and then add all other components under the mainframe that contain a UDim of
UDim2.new(0, x, 0, x)
but it doesn't seem to work, and screws up.
I am really not fond of how the scaling and pixel size system works.
This happens because the screen you're using in studio is smaller then the only you're using online. While testing how your gui looks you should always check if it fits in various sizes.