How does temperature affect density?
When an object heats up, it expands (usually). The expansion makes the volume increase. Since the mass doesn't change and the volume increases, the density, which is mass/volume, decreases.
If the volume is constrained (eg gas in a metal tank) changing the temperature doesn't alter density (but it might change the pressure).
When water freezes it actually expands slightly and the density goes down not up as you would expect...this explains why ice floats.
Separate names with a comma.