Flux sometimes means total flow through a surface (a scalar), and sometimes means flow per unit area (a vector).
In electromagnetism, flux always means total flow through a surface (a scalar).
Scalar flux is the amount of a vector field going through a surface: it is the integral (over the surface) of the normal component of the field:
For a closed surface, this equals (Gauss' theorem, or the divergence theorem) the integral (over the interior) of the divergence of the field: .
Therefore the scalar flux, through a closed surface, of an electric field is proportional to the enclosed charge (Gauss' law: ), and of a magnetic field is zero (Gauss' law for magnetism: ).