Html CSS中的版权符号:伪元素之后

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7770444/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 11:07:41  来源:igfitidea点击:

Copyright Symbol in CSS :after Pseudo-Element

htmlcsspseudo-element

提问by Justin Mrkva

SOLVED- used \00a9instead of ©

已解决- 使用\00a9而不是©

Pretty self-explanatory:

不言自明:

body:after {
    content: "© me";
    /* other formatting */
}

In HTML, the ©sequence inserts a copyright character. Can this be done in CSS Pseudo-Elements like I'm trying to do here?

在 HTML 中,该©序列插入版权字符。这可以像我在这里尝试做的那样在 CSS Pseudo-Elements 中完成吗?

回答by Spudley

CSS doesn't use HTML's entities; it uses its own unicode escape sequences.

CSS 不使用 HTML 的实体;它使用自己的 unicode 转义序列。

You need to use \00a9for the copyright symbol.

您需要使用\00a9版权符号。

body:after {
  content:"##代码##a9 me";
}

See here for a cheat-sheet table which shows just about every entity/unicode string you'd ever need: http://www.evotech.net/blog/2007/04/named-html-entities-in-numeric-order/

请参阅此处的备忘单表,其中显示了您需要的几乎每个实体/Unicode 字符串:http: //www.evotech.net/blog/2007/04/named-html-entities-in-numeric-order /