A quick YouTube search reveals a plethora of floating astronaut videos. They can spin in the air, juggle bubbles of water and their hair looks ridiculous. It certainly appears that there’s no gravity in space — but appearances are deceiving.
Astronauts in orbit are more accurately in free fall. They’re constantly falling towards Earth — which means Earth is keeping quite the gravitational hold on them. They just happen to be also moving fast enough that they keep missing the ground.
Gravity does weaken with distance. But for massive objects like stars and planets, their gravitational reach is enormous. Without Earth’s gravity, the Moon (which orbits roughly a thousand times farther away than the International Space Station) would fly off into the depths of space. Instead, Earth keeps it on a gravitational tether. Likewise, the Sun retains a grasp over not just Earth and Jupiter and Pluto, but even the Oort Cloud of comets, which extends a full light-year away.
The Sun is subject to the gravity of the massive black hole at the center of the Milky Way. And the Milky Way itself dances to the gravitational drumbeat of other nearby galaxies.
In short, it’s hard to find objects in space that aren’t subject to something else’s gravitational tug.