Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to replace text in css?

I was taking a test in fiverr. There I got the following question:

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

What will be the output of the following string if the text replace style is implemented?

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

>Solution :

The answer is #2:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

“cndy lives cehind ccfe”

The exact CSS sample appears in the spec, linked above, and the example is described as follows (emphasis mine):

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" }

So the processing order goes:

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

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading