Weight depends on mass and gravitational acceleration. Mass is proportional to density for a fixed volume. The ratio of weights for the same volume of different substances is equal to the ratio of their densities.