Ling-height parent element is provided; child elements inherit parent element line-height
1.ling-height: fixed pixel
body{ font-size:20px; line-height: 24px; } p{ font-size: 16px; }
At this time, the p element line-height = 24px
2.line-height: Percentage
body{ font-size:20px; line-height: 200%; } p{ font-size: 16px; }
At this time, a high p element row is calculated after the body. line-height = 200% * 20 = 40px;
3.line-height: Numerical
body{ font-size:20px; line-height: 1.5; } p{ font-size: 16px; }
At this time, a high p-line on the page of the original pigment was 1.5 * 16px = 24px;
4、line-height: em
body{ font-size:20px; line-height: 1.5em; } p{ font-size: 16px; }
At this time, a high p element row is calculated after the body. line-height = 1.5 * 20 = 24px;