简体   繁体   English

如何在没有javascript的情况下在html中显示unicode?

[英]how to display unicode in html without javascript?

How do you display unicode character U+1F698, in the Transport And Map Symbols Block, in an html page preferably without using Javascript? 如何在html页面中的运输和地图符号块中显示unicode字符U + 1F698,最好不使用Javascript? I have found the following html scape secuence: 🚘 我找到了以下html scape secuence: 🚘 which, when included in an html page, shows the following square symbol 🚘, tested in chrome and firefox. 当包含在html页面中时,它显示以下方形符号🚘,在chrome和firefox中测试。

The codepoints website appears to have a solution. codepoints网站似乎有一个解决方案。 They use the Symbola font which is added to the page using @font-face , and that renders some unicode symbols correctly, including the one specified in your question. 它们使用Symbola字体 ,该字体使用@font-face添加到页面中,并正确呈现一些unicode符号,包括问题中指定的符号。

@font-face include (for testing, don't actually link to codepoints stylesheet when in production, instead copy it locally and link there instead): @font-face include(用于测试,在生产时实际上不链接到代码点样式表,而是在本地复制并链接到那里):

<link rel="stylesheet" href="http://codepoints.net/api/font-face/Symbola.css">

Displaying the character: 显示角色:

<span style="font-family: Symbola, serif;">&#x1F698;</span>

You probably do not have a suitable font that can display this symbol, or the font you have set it to cannot display it. 您可能没有合适的字体可以显示此符号,或者您设置的字体无法显示它。

You could check if you have a font that has that character on this page . 您可以检查此页面上是否包含具有该字符的字体。

According to this page , the only major font that supports this character is Symbola . 根据这个页面 ,唯一支持这个角色的主要字体是Symbola (LastResort is not a real font ) (LastResort 不是真正的字体

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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