- We describe properties of perpendicular electron heating in inhomogeneous E⊥B fields. The heating is due to the demagnetization of the electrons when the electric field slope becomes large enough such that e||DeltaE||/ meOmega2>1, Omega=eB/me. Electrons can be efficiently accelerated across the magnetic field by the electric field. Such a phenomenon may occur in the ramp of a quasi-perpendicular collisionless shock, resulting in the effective transfer of the cross-shock potential energy into the downstream electron gyration energy. This energization should be observed as heating. Numerical analysis of electron dynamics in a model shock structures shows that experimentally observed dependencies are reproduced quite naturally. Efficiency of the proposed mechanism depends on the electric field scale in the shock front. Available obsevational data do not allow unambiguous conclusions about the presence of necessary scales. On the other hand, electron measurements and comparison with the proposed mechanism can help understand the shock fine structure.