我的html代码中,需要显示❤这个符号,但在chrome调试器中发现不能正常显示,只显示一个方形框包裹的问号,个人感觉应该是字体或者字符库的缺失造成的,但百度无果,不知道其属于哪个字符集,如何正常显示呢?
这是我的html头部
<head lang="en"><meta charset="UTF-8"> <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="format-detection" content="telephone=no"> <link rel="stylesheet" href="../css/public-style.css"/> <link rel="stylesheet" href="../css/animate.min.css"/> <link rel="stylesheet" href="../css/page2.css"/> <title></title>
</head>
你现在在看的这个网页就显示了❤,你去看看不就知道了?
当今绝大部分计算机能处理的字符都属于 Unicode 字符集。你使用 UTF-8 字符编码就可以了。
没有字体而显示为方框,这和字符集没什么关系。这是你没有相应的字体。你当然不可能让用户装了字体之后再来访问你的网页,所以你可以用 Web fonts。
PS: 我这里用于显示这个字符的字体叫 EmojiOne Color。