The zero-temperature response of an interacting electron liquid to a time-dependent vector potential of wave vector q and frequency , such that qӶq F , qv F Ӷ ӶE F /ប ͑where q F , v F , and E F are the Fermi wave vector, velocity, and energy, respectively͒, is equivalent to that of a continuous elastic medium with nonvanishing shear modulus , bulk modulus K, and viscosity coefficients and . We establish the relationship between the viscoelastic coefficients and the long-wavelength limit of the ''dynamical local-field factors'' G L(T) (q, ), which are widely used to describe exchange-correlation effects in electron liquids. We present several exact results for , including its expression in terms of Landau parameters, and practical approximate formulas for , , and as functions of density. These are used to discuss the possibility of a transverse collective mode in the electron liquid at sufficiently low density. Finally, we consider impurity scattering and/or quasiparticle collisions at nonzero temperature. Treating these effects in the relaxation-time ( ) approximation, explicit expressions are derived for and as functions of frequency. These formulas exhibit a crossover from the collisional regime ( Ӷ1), where ϳ0 and ϳnE F , to the collisionless regime ( ӷ1), where ϳnE F and ϳ0. ͓S0163-1829͑99͒02632-6͔