You noticed that when you added dry ice to the water, a cloud of carbon dioxide and water was produced. But unlike smoke from a candle or fire, the dry ice smoke doesn’t float. Instead, it settles onto the ground or, in this case, on top of the water. Why is that? The smoke is actually a combination of carbon dioxide gas and water vapor. This gaseous dry ice smoke is heavier than the air around it, so it sinks in the air rather than rising.
The same relation between air and dry ice smoke explains why the bubbles float on top of the dry ice smoke. The air exhaled into the bubble is less dense than the gases comprising the dry ice smoke, but slightly heavier than the air surrounding the bubble. So although the bubble doesn’t float in the air, it does float on the heavier dry ice smoke.