The application of a liquid crystal (LC) in displays has driven the development of novel LC elements. In this Letter, polarization variable line-space (PVLS) gratings based on photoalignment are fabricated, and their variable-spacing properties are derived using the vector diffraction theory. Both transmissive and reflective PVLS gratings are fabricated to validate the correctness of the derivation. Experimental results indicate that PVLS gratings have a wider wavelength response bandwidth than that of polarization volume grating (PVG). PVLS gratings have angle selectivity, and a large incident angle causes wavelength blueshift. Additionally, the relationship between wavelength and focal length indicates its anomalous dispersion as a diffractive optical element. These results of photoalignment-based PVLS gratings provide valuable insights for the advancement of displays and have the potential to improve visual experiences.