我注意到一起使用letter-spacing
和text-align: center
一起使用的奇怪行为。增加空间,使文本更靠近元素的左边距。
div {
width: 400px;
height: 200px;
background-color: #3b0d3b;
text-align: center;
margin: auto;
}
p {
color: #fff;
margin-top: 40px;
text-align: center;
padding-top: 10px;
font-size: 1.2em;
}
.spacing {
letter-spacing:.4em; /* This property is the problem */
}
.spacing-large {
letter-spacing:.9em; /* This property is the problem */
}
<div>
<p>- Foo Bar Zan -</p>
<p class="spacing">- Foo Bar Zan -</p>
<p class="spacing-large">- Foo Bar Zan -</p>
</div>
我在上一个 Firefox 和 Chrome 上发现了相同的行为。有没有办法解决这个问题?