当前位置: 动力学知识库 > 问答 > 编程问答 >

html - why text with different size have different alignment

问题描述:

i have this behavior:

Why the text have that space?

My goal is to left align the text with that one below.

Here what i have done:

CSS

.btn-basic {

font-size: 5.8em;

white-space: nowrap;

border: medium none;

}

.btn-basic p {

font-size: 0.3em;

line-height: 1.0em;

white-space: nowrap;

}

HTML

 <div class="btn-basic">

FREE WI-FI

<p>Gratis. Senza limiti. Anche in streaming.</p>

</div>

网友答案:

Because character glyphs have space around them so they don't butt up against other character.

See:

span {
  font-size: 144px;
  color: white;
  background: #000;
  font-family: sans-serif;
}
<span>F</span>
<span>G</span>
<span>FG</span>
分享给朋友:
您可能感兴趣的文章:
随机阅读: