Depth of field is controlled by three main factors i.e. aperture, lens focal length and the shooting distance. Your aperture & lens focal length depends on the shooting distance. So, we can say that selecting or choosing a right aperture setting & focal length can guarantee that the dephth-of-field in your photos is absolutely appropriate.
Here's a quick reference guide to understand the relation between aperture, focal length and the shooting distance.
- Smaller aperture = deeper depth of field (the other two factors remaining the same i.e. focal length & shooting distance). For e.g. Keeping focal length and shooting distance the same, you'll see a much deeper depth of field at f/16 than at f/1.4 aperture.
- Shorter focal length = deeper depth of field (the other two factors remaining the same i.e the aperture & shooting distance). For e.g., If you compare a 28mm lens with a 50mm lens at same aperture & shooting distance, You'll find that depth of field is deeper with the 28mm lens as compared to 50 mm lens.
- Greater shooting distance = deeper depth of field (keeping the other two factors i.e.focal length & aperture same). For e.g, if the subject is photographed from different distance each time, the zone of sharpness in the foreground and background is greater when shot from a greater distance as compared to when shot from a small distance.
Another very important characteristic of depth of field is that it is generally deeper in the background than in the foreground.