Virtually all dinosaurs died off about 65 million years ago. They all died over a very short period of time, probably from changes in the climate brought on by dust kicked up from the collision of a large asteroid with earth. It is also possible that they died from a number of volcanoes that formed and erupted at the same time, causing ash and dust to pollute the atmosphere, resulting in extreme climate change.
Mammals appeared on earth towards the end of the dinosaur
era. Characterized by having fur or hair, the first mammals
were warm-blooded animals that were very small, usually
just a few inches long.
They survived being eaten by the dinosaurs primarily because of their small size and their ability to live in trees. They mostly fed on plants and insects.
The extinction of the dinosaurs probably occurred from cold weather brought on by dust kicked up by an asteroid impact with earth that blocked out a lot of sunlight. Mammals were probably able to survive the resultant cold weather because they had fur and were warm blooded, so they could stay warm better than the dinosaurs.
With the dinosaurs gone, mammals were able to flourish as they no longer had to compete with the dinosaurs for food, and also did not have to worry about being eaten by dinosaurs! Oddly enough, some current mammals, such as giraffes and elephants, have evolved to almost the size and shape of many of the dinosaurs.
So, the next time you see a dog or cat, remember that his distant relative lived during the time of the dinosaurs!