Here's why:
* Solids have a definite shape and volume.
* Liquids have a definite volume but take the shape of their container.
* Foams are a mixture of a liquid and a gas, with the gas dispersed throughout the liquid in the form of bubbles. This gives shaving cream its airy, bubbly texture. The bubbles are held together by a liquid film.
So, shaving cream is technically a colloidal dispersion, specifically a foam.