In what kind of environment did dinosaurs live?

The key clues for answering this question are found in the sequences of rock layers that contain dinosaur fossils.

Most of the dinosaurs we have found lived along ancient rivers or streams and roamed across the adjacent forested floodplains and densely vegetated swamps and lakes. Some discoveries have also shown that dinosaurs inhabited ancient deserts strewn with fields of sand dunes. Dinosaur skeletons have also been found along the sandy shorelines of ancient seas. Sediments representing mountainous environments are fairly rare, since erosion and is more common in these habitats. So examples of mountain-dwelling dinosaurs are also rare.