在不使用JS的情况下,我想用CSS删除重音,这样HTML在语义上继续保持正确,同时在视觉上实现没有重音的大写。
例:
h1 {
text-transform: uppercase;
/*sth here*/
}
<h1>Fácil</h1>
TKS!
您可以调整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>