How can the density of a liquid be measured?

The definition of density is mass per unit volume. Thus, you measure the volume of a liquid in mls, and then weight that volume in grams. You thus obtain grams/volume, and that is the density expressed as grams per ml.