You can escape the single quote: http://jsfiddle.net/NKHaQ/1/
.foo:after{ content: '7\'4'; }
Alternatively, you can specify the value twice:
.foo:after{ content: "7'4"; }
Double quotes cannot be found inside double quotes unless escaped (like "\" "or like" \ 22 "). Likewise for single quotes ('\' 'or' \ 27 ').
content: "this is a 'string'."; content: "this is a \"string\"."; content: 'this is a "string".'; content: 'this is a \'string\'.';
You can also do this: http://jsfiddle.net/NKHaQ/4/
.foo:after{ content: '7\27 4'; }
However, in addition to being difficult for you to read, this creates the potential for a subtle problem. If you omit the space after \27 , it will work along with 4 , which is then parsed as \274 , which gives the wrong conclusion.
source share