I believe that you are talking about a glass of water turned upside down with a playing card over the bottom. The card and water hold position in seeming defiance to gravity.
You suspect that it has something to do with the density of the fluid -- water in this case. No. That is not it. Surface tension plays a role. It ensures that the seal between card and glass is tight so that air cannot slowly leak in. Atmospheric pressure plays a role. It provides the upward force required to keep the water and card in place. There is another effect that I have always used when performing this trick -- the flexibility of the card.
When you perform this trick you start with the glass upright, fill it to the brim and put the playing card over the top. It is important that the glass be completely full. First, so that the card/glass surface is wetted. Second, so that there will be little or no air in the glass when it is inverted. Hold the card in place with an even pressure so that a seal is maintained and invert the glass. Before you release your hand, press firmly in the center of the card so that a little water is squeezed out from the sides. This creates a bit of suction. The water at the bottom of the glass is under slightly less than atmospheric pressure. The difference is enough to support the card and maintain the seal with the glass. In effect, you have turned the playing card into a suction cup.
If you allow too much air to remain in the glass, that air can expand and make it difficult or impossible to achieve the required suction. It is not the low density of the air that is the problem. It is the fact that it is compressible.