A large number of clinical studies demonstrate that the ketogenic diet (KD) may be an effective approach to the reduction of epileptic seizures in children and adults. Such dietary therapy could also help pregnant women with epilepsy, especially since most antiseizure drugs have teratogenic action. However, there is a lack of medical data, considering the safety of using KD during gestation for the progeny. Therefore, we examined the influence of KD used prenatally in rats on the elemental composition of the selected brain regions in their offspring. For this purpose, synchrotron radiation-induced X-ray fluorescence (SR-XRF) microscopy was utilized, and elements such as P, S, K, Ca, Fe, and Zn were determined. Moreover, to verify whether the possible effects of KD are temporary or long-term, different stages of animal postnatal development were taken into account in our experiment. The obtained results confirmed the great applicability of SR-XRF microscopy to track the element changes occurring in the brain during postnatal development as well as those induced by prenatal exposure to the high-fat diet. The topographic analysis of the brains taken from offspring of mothers fed with KD during pregnancy and appropriate control individuals showed a potential influence of such dietary treatment on the brain levels of elements such as P and S. In the oldest progeny, a significant reduction of the surface of brain areas characterized by an increased P and S content, which histologically/morphologically correspond to white matter structures, was noticed. In turn, quantitative elemental analysis showed significantly decreased levels of Fe in the striatum and white matter of 30-day-old rats exposed prenatally to KD. This effect was temporary and was not noticed in adult animals. The observed abnormalities may be related to the changes in the accumulation of sphingomyelin and sulfatides and may testify about disturbances in the structure and integrity of the myelin, present in the white matter.