The flexoelectric effect is very strong and coupled with large strain gradients for nanoscale dielectrics. At the nanoscale, the electrostatic force cannot be ignored. In this paper, we have established the electric enthalpy variational principle for nanosized dielectrics with the strain gradient and the polarization gradient effect, as well as the effect of the electrostatic force. The complete governing equations, which include the effect of the electrostatic force, are derived from this variational principle, and based on the principle the generalized electrostatic stress is obtained, the generalized electrostatic stress contains the Maxwell stress corresponding to the polarization and strain, and stress related to the polarization gradient and strain gradient. This work provides the basis for the analysis and computations for the electromechanical problems in nanosized dielectric materials. flexoelectric effect, variational principle, governing equations, dielectrics, electrostatic stress, nanoscale PACS: 46.05.+b, 46.25.Hf, 62.25.+g, 68.35.Md