Mercury-in-glass thermometer - Wikipedia
One special kind of mercury-in-glass thermometer, called a maximum thermometer, works by having a constriction in the neck close to the bulb. As the temperature rises, the mercury is pushed up through the constriction by the force of expansion.