What is the difference between px and em? What units do you know about?

px absolute unit, the page
is displayed in precise pixels. Em is a relative length unit, and EM is designed relative to the parent element.
Other units
rem is a relative unit, the root element is relatively HTML
% percentage of the ratio of the size of the parent element of the set of
vw / vh with respect to the window width / height, 1vw equals window width / height of 1%

// Expand the following to show that the fonts displayed by the vw / vh derived units in the vertical and horizontal screens are consistent
.
vmax: the larger of vw and vh

 

 

Published 203 original articles · praised 8 · 10,000+ views

Guess you like

Origin blog.csdn.net/z591102/article/details/105533373