Three-dimensional particle-in-cell simulations show that the periodic solid-state structures irradiated by intense ($sim 10^{19}$ W/cm${}^2$) laser pulses can generate collimated electron bunches with energies up to 30 MeV (and acceleration gradient of $11.5$ GeV/cm), if the microstructure period is equal to the laser wavelength. A one-dimensional model of piecewise acceleration in the microstructure is proposed and it is in a good agreement with the results of numerical simulations. It shows that the acceleration process for relativistic electrons can be theoretically infinite. In the simulations, the optimal target parameters (the width of the microstructure elements and the microstructure period) are determined. The explored parameters can be used for proof-of-principle experiments demonstrating an ultrahigh gradient acceleration by a number of identical and mutually coherent laser pulses [A. Pukhov et al., Eur. Phys. J. Spec. Top. 223, 1197 (2014)].