Answer
The overflow happens because the liquid gasoline expands more than the solid tank does, for the same temperature increase.
This is similar to how an increase in temperature causes the liquid mercury in an old-style thermometer to rise inside the glass tube.
Work Step by Step
This is discussed on page 293.