*{
margin: 0;
padding: 0;
}
header{
text-align: center;
background-color: rgb(61, 61, 61);
padding: 15px;
}
/* this is where i would place the line height. remove comment tags to see result */
/* header p{
line-height: 5px;
} */
<header>
<h1>I'm a centered Title</h1>
<p>Cool Slogun underneath!</p>
</header>
“ hitbox”解释IG..
蓝色hitbox包含标题和口号。
如何将线路高度添加到标题本身,而不是p?
*{
margin: 0;
padding: 0;
}
header{
text-align: center;
background-color: rgb(61, 61, 61);
padding: 15px;
line-height: 20px;
}
<header>
<h1>I'm a centered Title</h1>
<p>Cool Slogun underneath!</p>
</header>