they all lived in different habitats some dinosaurs lived in the deserts and others in the swamps, and the grasslands.
Every one but the arctic.
Gerrothorax is a giant amphibian, not a dinosaur. It lived in freshwater swamps.
There were thoudands of different dinasaurs that all lived in different enviroments. Your question is too open-ended to answer.
Woodlands of North America
t-rex
Jurassic Park: The Game The Dinosaurs Return Trailer
The Australian Kangroo and Its Habitat
The Habitat and Mating Rituals of the Albatross
How People Live Around Lakes