Using a low-strain, isotopically pure crystal of YLiF4, we have measured extremely narrow inhomogeneous linewidths (as low as 40 MHz) for the optical transitions of Er3+ impurities. Inhomogeneous broadening due to strains and other defects is so low that a new mechanism limits the inhomogeneous linewidth: local magnetic fields due to fluorine nuclear spins. These ultranarrow lines enabled us to make the first direct measurement of the isotope shifts of f-f transitions in a solid, and we find for the isotopes Er164, Er166, Er168, and Er170 a shift of 76±2 MHz unit mass on the 4I15/2(1)4F9/2(1) transition. We show that this is consistent with a mechanism of coupling to zero-point vibrations. © 1992 The American Physical Society.