Matter normally exists as a solid, a liquid or a gas, and the state depends on how its particles move. In a solid the particles are closely spaced and vibrate in place, so a solid keeps its shape and volume. In a liquid the particles stay in contact but slide past one another, so a liquid keeps its volume but takes the shape of its container. In a gas the particles are widely spaced and fly about until they collide, so a gas fills whatever container it is in. Air is a gas, and it is matter: a bag of air has mass and takes up space.