  Pulsar-like compact stars usually have strong magnetic fields, with the
strength from $\sim 10^8$ to $\sim 10^{12}$ Gauss on surface. How such strong
magnetic fields can be generated and maintained is still an unsolved problem,
which is, in principle, related to the interior structure of compact stars,
i.e., the equation of state of cold matter at supra-nuclear density. In this
paper we are trying to solve the problem in the regime of solid quark-cluster
stars. Inside quark-cluster stars, the extremely low ratio of number density of
electrons to that of baryons $n_e/n_b$ and the screening effect from
quark-clusters could reduce the long-range Coulomb interaction between
electrons to short-range interaction. In this case, the Stoner's model could
apply, and we find that the condition for ferromagnetism is consistent with
that for validity of Stoner's model. Under the screened Coulomb repulsion, the
electrons inside the stars could spontaneously magnetized and become
ferromagnetic, and hence would contribute non-zero net magnetic momentum to the
whole star. We conclude that, for most cases in solid quark-cluster stars, the
amount of net magnetic momentum, which is proportional to the amount of
unbalanced spins $\xi=(n_+-n_-)/n_e$ and depends on the number density of
electrons $n_e=n_++n_-$, could be significant with non-zero $\xi$. The net
magnetic moments of electron system in solid quark-cluster stars could be large
enough to induce the observed magnetic fields for pulsars with $B\sim 10^{11}$
to $\sim 10^{13}$ Gauss.
