我有以下代码:
.testFont {
font-size: 16px;
}
<!DOCTYPE HTML>
<html>
<head>
</head>
<body>
<div class="outter">
<div class="testFont">▴</div>
<div class="testFont">▾</div>
</div>
</body>
</html>
下面的 unicode 表显示我上面使用的箭头的大小应该相等(从目测来看):
为什么它们呈现不同? 我怎样才能得到等效的箭头大小?
更新
在 Chrome 和 Safari 上测试都使向下箭头变大?
输出图片
最佳答案
这是因为 Lucida Grande 字体,它可能是您系统上的默认字体:
为避免这种情况,请自己定义要使用的字体(最好是一种网络字体,这样您就可以确保每个人看到的都是一样的,但我不知道支持这些字形的字体)。
.testFont {
font-size:16px;
/* only tested on mac OS,
if someone could lead me to default win and *nix default fonts,
I'd be glad to include it
*/
font-family: 'Arial Unicode MS', 'Consolas';
}
<div class="outter">
<div class="testFont">▴</div>
<div class="testFont">▾</div>
</div>
关于html - Unicode 不同大小的箭头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42966871/