Get a real thermometer and see how the red liquid is trapped in a narrow tube.

Place your fingers on the bulb of the thermometer. This makes the liquid in the bulb hot and swell and the liquid in the tube gets longer.

You can make a simple bottle thermometer by making a hole in a cork and fitting a straw tightly in to it. You then fill the bottle with water to the very top and push on the cork. Water will flow up the straw.

If you watch the level of water in the straw, you will see the level rise and fall as the air changes temperature.