We describe an x-ray absorption method for in situ density measurement of non-crystalline materials in the diamond anvil cell using a monochromatic synchrotron x-ray microbeam. Sample thickness, which is indispensable in the absorption method, can be determined precisely by extrapolating the thickness profile of the gasket obtained by x-ray absorption and diffraction measurements. Diamond deformation across the sample chamber becomes noticeable at high pressures above 10 GPa, which can be monitored with a precision better than 1%, as demonstrated by measurements on crystalline Ag. We have applied the developed method to measure densities of the classic network-forming GeO(2) glass in octahedral form at pressures up to 56 GPa. The fit to the pressure-volume data with the Birch-Murnaghan equation from 13 to 56 GPa gives parameters of V(0)=23.2+/-0.4 cm(3)mol and K=35.8+/-3.0 GPa, assuming that K(')=4. This method could be applicable for in situ determination of the density of liquids and other noncrystalline materials using a diamond anvil cell up to ultrahigh pressures.