Pterosaurs are an extinct clade of flying reptiles in the order Pterosauria. They existed during most of the Mesozoic: from the Late Triassic to the end of the Cretaceous (228 million to 66 million years ago). Pterosaurs are the earliest vertebrates known to have evolved powered flight. Their wings were formed by a membrane of skin, muscle, and other tissues stretching from the ankles to a dramatically lengthened fourth finger.
Traditionally, pterosaurs were divided into two major types. Basal pterosaurs (also called non-pterodactyloid pterosaurs or 'rhamphorhynchoids') were smaller animals, up to two meter wingspan, with fully toothed jaws and, typically, long tails. Their wide wing membranes probably included and connected the hindlimbs. On the ground, they would have had an awkward sprawling posture due to short metacarpals, but the anatomy of their joints and strong claws would have made them effective climbers, and some may have lived in trees. Basal pterosaurs were insectivores, piscivores or predators of small land vertebrates. Later pterosaurs (pterodactyloids) evolved many sizes, shapes, and lifestyles. Pterodactyloids had narrower wings with free hindlimbs, highly reduced tails, and long necks with large heads. On the ground, they walked well on all four limbs due to long metacarpals with an upright posture, standing plantigrade on the hind feet and folding the wing finger upward to walk on the metacarpals with the three smaller fingers of the hand pointing to the rear. They could take off from the ground, and fossil trackways show that at least some species were able to run, wade, and/or swim. Their jaws had horny beaks, and some groups lacked teeth. Some groups developed elaborate head crests with sexual dimorphism. Since 2010 it is understood that many species, the basal Monofenestrata, were intermediate in build, combining an advanced long skull with long tails.