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:在对内容中的字符进行编码之后


基础教程推荐
- 每次设置弹出窗口的焦点 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01