简体   繁体   中英

Unicode different size arrows

I have the following code:

 .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> 

The unicode table below shows that the arrows I used above should be equivalent in size (from visual inspection):

在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

Why are they rendered differently? And how can I get equivalent arrow sizes?

Fiddle

Update

Tested on Chrome and Safari both render the down arrow bigger?

Output Image

在此处输入图片说明

This is because of Lucida Grande font, which might be the default font on your system :

在此处输入图片说明 在此处输入图片说明

To avoid it, define the font to use yourself (better a webfont so you'd be sure every one will see the same, but I don't know one that does support these glyphes).

 .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> 

It seems as if the arrows are the same size, I think it is an optical illusion. See fiddle with arrows output: https://jsfiddle.net/uv8yrrav/21/ I have not changed any of your code:

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

</body>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM