We present theoretical calculations of the energy-loss straggling of C, Al, Si, and Cu targets for H, He, and Li ions in the range of intermediate to high energies . These calculations have been done by employing the dielectric formalism and by considering the different equilibrium charge states of the swift ion inside the solid as a function of its energy. Two different models are used: the Mermin energy-loss functions combined with generalized oscillator strengths (MELF-GOS) and the shellwise application of the local plasma approximation (SLPA). The MELF-GOS describes the target outer-electron excitations through a fitting to experimental data in the optical limit, employing a linear combination of Mermin-type energy-loss functions; the excitations of the inner-shell electrons are taken into account by means of generalized oscillator strengths. The SLPA employs a free-electron-gas model for the target valence electrons and the local density approximation for each shell of target electrons separately by using Hartree-Fock atomic wave functions. The results of the energy-loss straggling obtained by the two independent models show good agreement with the available experimental data. The calculated energy-loss straggling tends at high energies to the Bohr value and takes values below it at intermediate energies. The Bethe-Livingston shoulder (or overshooting) at intermediate energies does not appear in the present calculations. We find that the energy-loss straggling normalized to is almost independent of the ion atomic number ; therefore, the results for H, He, and Li projectiles in each target can be approximated by a universal curve at high energies.