The liquid in a thermometer is sometimes colored alcohol but can also be a metallic liquid called mercury. Mercury and alcohol expand when heated and shrink when cooled. Inside the glass tube of a thermometer, the liquid has no place to go but up when the temperature is hot and down when the temperature is cold. That's how a thermometer that uses liquid to measure temperature.