The holographic principle in gravitational theories follows from the generalized second law of thermodynamics, for asymptotically static backgrounds. I consider how this generalizes to more complicated backgrounds, including cosmological models. For certain simple cases, the cosmological holographic bound proposed by Fischler and Susskind is recovered. A modified version of the bound holds in inflationary models. However, for closed universes, or inside black hole event horizons, no simple relation connects the area of a region to the maximum entropy it can contain.