如何在中插入 Unicode U+2665 HTML?
我想在 HTML 标题中插入 unicode U+2665。因此,我做了:
<h2 id="listas">U+2665 listas</h2>
不幸的是,当浏览器呈现时,这会生成以下输出:
我尝试将“和百分比”与 &U+2665
一起使用。但它也没有成功。
我应该怎么做才能解决这个问题?
谢谢。
I wanna insert unicode U+2665 in heading of HTML. Thus, I did:
<h2 id="listas">U+2665 listas</h2>
Unfortunately, this generates the following output when rendered by the browser:
I tried using "and percent" with &U+2665
. But it did not work out either.
What should I do to fix this?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用字符实体引用中的十六进制标量值输入任何 Unicode 字符
,该字符将显示为 ♥
其他答案类似,但需要将 Unicode 标量值转换为十进制。但您可以直接以十六进制输入。
You can enter any Unicode character using it's hex scalar value in a character entity reference
That will display as ♥
The other answers were similar, but require converting the Unicode scalar value to decimal. But you can enter it directly in hex.
大概是这样的:
您可以检查像这样的页面中的 HTML 实体
https://www.compart.com/en/unicode/U+2665
预览:
https://jsfiddle.net/0mne9kL1/
It would be something like that:
You can check the HTML entity in pages like this one
https://www.compart.com/en/unicode/U+2665
Preview:
https://jsfiddle.net/0mne9kL1/