The Late Cretaceous appearance of grasses, followed by the Cenozoic advancement of grasslands as dominant biomes, has contributed to the evolution of a range of specialized herbivores adapted to new diets, as well as to increasingly open and arid habitats. Many mammals including ruminants, the most diversified ungulate suborder, evolved high-crowned (hypsodont) teeth as an adaptation to tooth-wearing diets and habitats. The impact of different causes of tooth wear is still a matter of debate, and the temporal pattern of hypsodonty evolution in relation to the evolution of grasslands remains unclear. We present an improved time-calibrated molecular phylogeny of Cetartiodactyla, with phylogenetic reconstruction of ancestral ruminant diets and habitats, based on characteristics of extant taxa. Using this timeline, as well as the fossil record of grasslands, we conduct phylogenetic comparative analyses showing that hypsodonty in ruminants evolved as an adaptation to both diet and habitat. Our results demonstrate a slow, perhaps constrained, evolution of hypsodonty toward estimated optimal states, excluding the possibility of immediate adaptation. This augments recent findings that slow adaptation is not uncommon on million-year time scales.