Let a given quality of liquid exert force F in a direction θ with the horizontal. Resolving, we get Fcos θ along horizontal surface of liquid and Fsin θ along the vertical.

As there is no flow of liquid so Fcos θ should be zero.
Since, F ≠ 0, cos θ = 0
Or θ = 90°
i.e., a liquid at rest exerts normal force to the walls of the container.