(Depth of field is the Zone of Sharpness in a photograph)
4 Things control Depth of Field.
1. Lens selectiona wide angle lens has a large depth of field and a telephoto lens has a smaller depth of field.
2. Aperture The higher the aperture number (F22) the greater the depth of field.
3. Subject distanceThe distance from the subject to the camera helps determine the depth of field. As the distance from the subject increases, the depth of field increases provided the subject is placed in focus. With a macro lens you shooting very close up you have very little depth of field.
4. Your viewpoint The more a subject is placed in a horizontal plane in front of the lens, the greater the amount of that subject will be in focus. As you move the length of the subject back in the photograph while still focusing on the same point, the less of the subject will be in focus. Closer focus decreases depth of field meaning less of what you are photographing will be in focus.