html - Unicode 不同大小的箭头

标签 html css unicode

我有以下代码:

.testFont {
  font-size: 16px;
}
<!DOCTYPE HTML>
<html>

<head>
</head>

<body>
  <div class="outter">
    <div class="testFont">&#9652</div>
    <div class="testFont">&#9662</div>
  </div>
</body>

</html>

下面的 unicode 表显示我上面使用的箭头的大小应该相等(从目测来看):

enter image description here

enter image description here

enter image description here

为什么它们呈现不同? 我怎样才能得到等效的箭头大小?

Fiddle

更新

在 Chrome 和 Safari 上测试都使向下箭头变大?

输出图片

enter image description here

最佳答案

这是因为 Lucida Grande 字体,它可能是您系统上的默认字体:

enter image description here enter image description here

为避免这种情况,请自己定义要使用的字体(最好是一种网络字体,这样您就可以确保每个人看到的都是一样的,但我不知道支持这些字形的字体)。

.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">&#9652</div>
   <div class="testFont">&#9662</div>
</div>

关于html - Unicode 不同大小的箭头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42966871/

相关文章:

python - 调用 locale.strxfrm 时 Unicode 字符不在范围内

html - 尝试创建表格布局不适用于 CSS

css - 页脚位置太靠前

javascript - 输入复选框在选中时更改 div 颜色

javascript - Bootstrap Affix 更改列表项宽度

unicode - 如何在 YAML 多行字符串中进行 Unicode 转义?

html - 我应该在哪里存储与 UI 相关的东西?

javascript - 如何让子弹在 glidejs 中正常工作

html - 如何设置平行DIV?

python - UnicodeDecodeError 与 pandas.read_sql