如何替换 css 中的文本?

How to replace text in css?

我在 fiverr 考试。我有以下问题:

Consider the following code:
body{text-replace: "a" "b" "b" "c"}

如果实现文本替换样式,下面的字符串会输出什么?

 1. ndy lives behind cbfe
 2. cndy lives cehind ccfe
 3. andy lives behind cafe
 4. andy lives cehind bafe

答案是#2:

“cndy lives cehind ccfe”

确切的 CSS 示例出现在上面链接的规范中,示例描述如下(强调我的):

The two rules below yield the same result. In the first rule all ‘a’ characters are converted to ‘b’. Subsequently, all ‘b’ characters are converted to ‘c’. In the second rule, all ‘a’ and ‘b’ characters are converted directly to ‘c’.

body { text-replace: "a" "b" "b" "c" }
body { text-replace: "a" "c" "b" "c" }

所以处理顺序是:

 1. andy lives behind cafe
 2. bndy lives behind cbfe
 3. cndy lives cehind ccfe