We report an in-situ strategy initiating polymerization of liquid electrolytes in electrochemical cells to produce quasi-solid electrolytes with cross-linked structure; with such a strategy, ultraconformal interfacial contacts between cathode/electrolyte and electrolyte/anode are created. The solid electrolyte exhibits a high ionic conductivity of 4.3 mS cm−1, a Li-ion transference number of 0.55 at room temperature and a wide electrochemical window of 5.2 V. The robust LiF-rich solid electrolyte interphase (SEI) layer on the Li anode effectively prevents the dendrite growth and the pulverization of the Li anode. By applying the quasi-solid electrolyte in Li–LiNi0.85Co0.05Al0.1O2 (NCA), Li–LiNi0.6Co0.2Mn0.2O2 (NCM622) batteries, high specific discharge capacities and long cycling lifetime are achieved at large current densities. This work demonstrates the tremendous potential of the in-situ strategy in promoting the application of high-voltage Li metal batteries.