I am using Angular 2.
When I use this in SCSS file, it works well.
.text::after {
content: "\00a0\00a0";
}
However, when I move it in
styles: [``]
It shows:
Uncaught SyntaxError: Octal literals are not allowed in strict mode.
I know codes in styles: [``]
needs to be CSS codes.
And I tried
styles: [`
.text::after {
content: " ";
}
`]
But then the screen shows
directly. How can I write it correctly?
An octal integer literal begins with the digit 0 and contains any of the digits 0 through 7.
Octal literals start with 0o followed by a sequence of numbers between 0 and 7. Binary literals start with 0b followed by a sequence of number 0 and 1.
Python - Hexadecimal, octal, and binary literals Octal literals start with a leading 0o or 0O (zero and lower- or uppercase letter o), followed by a string of digits (0-7). In 2. X, octal literals can also be coded with just a leading 0, but not in 3.
An octal escape sequence is a backslash followed by one, two, or three octal digits (0-7). It matches a character in the target sequence with the value specified by those digits. If all the digits are '0' the sequence is invalid.
You need to escape it
.text::after {
content: "\\00a0\\00a0"; // now it's just a simple plain string
}
"use strict" is a new feature introduced in JavaScript 1.8.5 (ECMAScript version 5).
In which,
Or you can add u
(unicode) before the \
.
.text::after {
content: "\u00a0\u00a0"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With