Most compact cameras have a minimum focus distance which is approximately 1 metre. Users must check out their respective camera manuals for details. Now if you get closer, the subject will not remain in focus. A good way to photograph a child is to shoot outdoors, especially in gardens. Nature, especially the green of the grass and the blue of the sky are fine allies for an amateur photographer.
Children are best when natural.
Avoid having them staring into the camera lens at all times. Patience is the key and you will be rewarded with a classic snap of your little one. Most cameras have a maximum distance for the flash - which would be 5 mtrs. While using a flash, don't get too ambitious with the view. Night shots are very tempting for anyone with a camera - but are not easy to shoot.