如何使用CSS摆脱重音

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

在不使用JS的情况下,我想用CSS删除重音,这样HTML在语义上继续保持正确,同时在视觉上实现没有重音的大写。

例:

h1 {
  text-transform: uppercase;
  /*sth here*/
}
<h1>Fácil</h1>

TKS!

html css text semantics
1个回答
2
投票

您可以调整line-height并使用overflow:hidden,但在使用不同的font-family时要注意,您可能需要另一个值:

h1 {
  text-transform: uppercase;
  line-height: 0.75em;
  overflow: hidden;
}
<h1>Fácil é â ä</h1>
<h1 style="font-size:25px">Fácil é â ä</h1>
<h1 style="font-size:18px">Fácil é â ä</h1>

与另一个font-family

h1 {
  font-family:arial;
  text-transform: uppercase;
  line-height: 0.87em;
  overflow: hidden;
}
<h1>Fácil é â ä</h1>
<h1 style="font-size:25px">Fácil é â ä</h1>
<h1 style="font-size:18px">Fácil é â ä</h1>
© www.soinside.com 2019 - 2024. All rights reserved.