The layers of the atmosphere

The air is mostly nitrogen and oxygen, and it is divided into layers by whether temperature falls or rises with height, which is why weather stays in the troposphere and the ozone layer warms the stratosphere.

From AP Environmental Science.