Is my textbook using the law of partial pressures correctly?

My textbook shows that pressure fraction is equal to mole fraction because the same volume cancels: ![enter image description here](https://i.stack.imgur.com/ioZ8l.jpg)


But it violates (if I am not mistaken) the law in this example it gives:



> 
> the main components of dry air, by volume, are N2, 78.08%, O2, 20.95%, Ar, 0.93%, and CO2, 0.04%. What is the partial pressure of each gas in a sample of air at 1atm.
> 
> 
> 


The strategy it gives for solving this problem is by treating the volume percent as mole percent, and in turn as pressure percent. But obviously, each gas occupies a different volume, the law of partial pressure doesn't apply. **does it?**


Also, is it possible for different components of air to occupy different amounts of space in atmosphere? If atmosphere is a container, doesn't all components just occupy the same amount of space-the size of container?


