如何调整线高而不弄乱文本的“ hitbox”

问题描述 投票:0回答:1

*{ 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包含标题和口号。


  • 蓝色hitbox之箱之后的高度..yikes

    Blue hitbox containing title and slogun.. neat

  • 我如何将自己的口号和标题更接近而不弄乱?

    如何将线路高度添加到标题本身,而不是p?Blue hitbox after line height.. yikes

*{ margin: 0; padding: 0; } header{ text-align: center; background-color: rgb(61, 61, 61); padding: 15px; line-height: 20px; }
html css flexbox
1个回答
0
投票
<header> <h1>I'm a centered Title</h1> <p>Cool Slogun underneath!</p> </header>


最新问题
© www.soinside.com 2019 - 2025. All rights reserved.