Put your back wheel right on the edge, and use tyre squish to help you get across.
If you're finding you bounce off the floor trying it, start a tiny bit further back.
Also, to get really good at gaps you need to learn to preload... so as you're squishing your tyre you also quickly squat down whilst lowering your front wheel and then when you go, pull yourself into the bike.
Finally, unless you're super pro you might find that with this technique it helps to jump up and then push it forwards as you land.
If you watch some videos, pay attention to how they gap - you'll find they execute all these moves, but watching videos can help you understand where to put your body better, and to get a sense of timing.
I'm learning the same thing! I've been faffing around with it for ages, I know what to do but I just don't do it =/