CSS:after encoding characters in content(CSS:在对内容中的字符进行编码之后)
问题描述
我正在使用以下 CSS,它似乎可以正常工作:
I am using the following CSS, which seems to be working:
a.up:after{content: " ↓";}
a.down:after{content: " ↑";}
然而,这些字符似乎不能像这样编码,因为输出是文字并显示了实际的字符串:
The characters however cannot seem to be encoded like this, as the output is literal and shows the actual string:
a.up:after{content: " ↓";}
a.down:after{content: " ↑";}
如果我不能对其进行编码,我觉得我应该在 jQuery 中使用诸如 .append() 之类的东西,因为它支持编码.有什么想法吗?
If I can't encode it, it feels like I should use something such as .append() in jQuery, as that supports the encoding. Any ideas?
推荐答案
要在 content
中使用编码的 Unicode 字符,您需要提供字符本身(如您所做的那样)或它们的 UTF-8转义序列而不是 HTML 实体:
To use encoded Unicode characters in content
you need to provide either the characters themselves (as you do), or their UTF-8 escape sequences instead of HTML entities:
a.up:after { content: " 2193"; }
a.down:after { content: " 2191"; }
这篇关于CSS:在对内容中的字符进行编码之后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:CSS:在对内容中的字符进行编码之后


- addEventListener 在 IE 11 中不起作用 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- Fetch API 如何获取响应体? 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01