出于某种原因,这些锚标签不应用它们自己的行高,而是使用父标记.
它仅适用于锚标记的行高高于其父标记或者display属性设置为block的情况.
我是否错过了有关行高属性的内容?
.container {
max-width: 200px;
border: 2px black solid;
line-height: 5;
}
.container>a {
/*display: block; if uncomment this the line-height will work*/
line-height: 1.5;
width: 100%;
}Run Code Online (Sandbox Code Playgroud)
<div class=container>
<a>First</a>
<a>Second</a>
<a>Third</a>
<a>Fourth</a>
</div>Run Code Online (Sandbox Code Playgroud)