Skin produces vitamin D when it is exposed to sunlight. But children in developed countries now tend to spend less time outdoors. They are also more likely to use sunscreen, which blocks the rays that trigger the skin to make vitamin D.