如何在

中插入 Unicode U+2665 HTML?

发布于 2025-01-16 20:50:40 字数 426 浏览 4 评论 0原文

我想在 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:

enter image description here

I tried using "and percent" with &U+2665. But it did not work out either.

What should I do to fix this?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

蓝海似她心 2025-01-23 20:50:40

您可以使用字符实体引用中的十六进制标量值输入任何 Unicode 字符

<h2 id="listas">♥</h2>

,该字符将显示为 ♥

其他答案类似,但需要将 Unicode 标量值转换为十进制。但您可以直接以十六进制输入。

You can enter any Unicode character using it's hex scalar value in a character entity reference

<h2 id="listas">♥</h2>

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.

反话 2025-01-23 20:50:40

大概是这样的:

<h2 id="listas">♥ listas</h2>

您可以检查像这样的页面中的 HTML 实体
https://www.compart.com/en/unicode/U+2665

预览:
https://jsfiddle.net/0mne9kL1/

It would be something like that:

<h2 id="listas">♥ listas</h2>

You can check the HTML entity in pages like this one
https://www.compart.com/en/unicode/U+2665

Preview:
https://jsfiddle.net/0mne9kL1/

梦冥 2025-01-23 20:50:40
<h2>♥</h2>
<h2>♥</h2>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文