Yes, there is gravity in space, otherwise, all of our satellites around the Earth would float away. For that matter, Earth and the other planets would fly away from the Sun!!
Think about how gravity works. Objects are pulled to the center of the Earth. It's important to note its the center of the Earth, and not just "down." Now picture a cannon at the top of a huge tower. A cannon ball that is dropped from the tower will simply fall toward the base of the tower.
The cannon ball falls at a constant acceleration of 1g toward the earth, which Galileo showed is the same acceleration as everything else on the Earth! This is important to remember!!
What if the cannon ball is fired from the cannon, though? It still accelerates toward the earth at the same rate as the dropped ball, but it will move forward a bit while it falls. Because the Earth is round, the ground actually drops away from the ball! So the faster the ball is launched, the longer it will take to hit the ground.
In fact, if the ball was launched forward fast enough, it would never hit the ground at all. It would travel all the way around the earth and collide with the back of the cannon! This is how an orbit is achieved! Remember though, gravity is still pulling on the cannon ball. If it wasn't, the ball would just fly off into space in a straight line. That is Newton's first law, inertia, in action.
So the moon is like the cannon ball. It just moves forward as fast as it falls and therefore stays in orbit. As for the astronauts, they float in their space stations because the astronaut and the station are both falling toward the earth at the same rate. They are both in free fall.
The result is that the astronaut is never able to catch up to his spaceship. This is why he floats. You can experience this yourself with a trampoline and a baseball. As you bounce, release the baseball and from your perspective, it will appear to "rise up" from you hand, at least until you bounce again.