代码之家  ›  专栏  ›  技术社区  ›  Cybrix

如何在CSS内容属性中使用html实体?

  •  5
  • Cybrix  · 技术社区  · 14 年前

    很好的一天,

    今天早上我遇到了一个难题。我发现了 content 属性,该属性很好,但我不能在其中使用HTML实体。

    更具体地说,我想使用 é

    我就是这么想的: content: 'test with eacute \233'; test with eacute ÿ

    我也试过 \0233 , \0233c , \233c

    我不想更改页面的编码。

    提前谢谢你们!

    1 回复  |  直到 14 年前
        1
  •  9
  •   Cybrix    14 年前

    嗯,我发现那个网站: http://www.evotech.net/articles/testjsentities.html

    看起来像是 é ( &eacute , &#233 )转换为 \00E9

    现在, content: 'test with eacute \00E9';