because as you change the mass the volume will change and as you change the volume the mass will change too, it's a constant ratio for each element. Mass and volume are not factors that affect the density. factors that affect the density are temperature and type of the material/element