Gradients of absorption line indices are studied and mean stellar metallicities are estimated for 46 elliptical galaxies. The mean stellar metallicities range from [[Fe/H]] similar or equal to -0.8 to +0.2 and ellipticals with smaller central velocity dispersions tend to have lower [[Fe/H]]; thus the mass-metallicity relation holds not only for the galaxy center but also for the whole part of the galaxy. There is an evidence that the magnesium is enhanced systematically in all ellipticals by 0.2 dex with respect to the iron. Giant elliptical galaxies show lack of metal-poor stars (the G-dwarf problem). Metal-poor globular clusters of ellipticals formed well in advance of the formation of metal-rich ones which formed simultaneously with the bulk of stars of mother galaxies under the influence of galaxy chemical enrichment. The bimodal [Fe/H] distribution of globular clusters does not necessarily mean that elliptical galaxies formed by the mergers of disc galaxies.