Actually, it is sort of like the dust is floating in front of the sensor, except rather than floating, it's stuck what amounts to a piece of glass covering the sensor. You're not seeing the dust, you're seeing the shadow of the dust. Try this - take a light source a good distance from a surface (light over a dining table, for example). Put your hand right next to, but not touching, the table. That dark, hard-edged shadow that's about the same size as your hand is dust on film. Now, lift your hand a few inches. That lighter, softer-edged shadow is dust on a sensor. That's a simplified case, obviously, but similar in concept. That extra space between the dust and the photosites, unlike film where there's no space, means diffraction operates on sensor dust, and wider apertures literally allow the light waves to bend around the dust speck and fill in the shadow cast by the dust.