Three cases of line-height inheritance
- line-height=20px
body {
line-height: 20px;
font-size: 30px;
}
p {
font-size: 16px;
}
At this time, the line-height=20px of the p tag inherits the line-height=20px of the body
line-hieght=1.5
body { line-height: 1.5; font-size: 30px; } p { font-size: 16px; }
At this time, the line-height=1.5 of the p tag and the line-height=1.5 of the body are inherited. Then the line-height=16px * 1.5 = 24px of the p tag
line-hieght=200%
body { line-height: 200%; font-size: 30px; } p { font-size: 16px; }
At this time, the line-height=60px of the p tag, first calculate the line-height=200% = 200% * 30px = 60px of the body. Then the p tag inherits the body's line-height=60px
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。