CSS <string> Data Type
Description
The <string>
CSS data type represents character data surrounded with either single (') or double (") quote characters. Any Unicode characters can be included in the string, but many need to be expressed with escape sequences.
Unicode characters may also be entered directly, if the file is saved with the correct encoding and a @charset rule is declared at the top of the stylesheet file.
The CSS escape character is the backslash (). There are two ways to create an escape sequence:
- as a backslash followed by the special character (e.g., " for a double quote or for a backslash);
- as a backslash followed by a hexadecimal number representing the unicode value (e.g., 22 for a double quote, 263A for a smiley face or a for a line break); either lowercase or uppercase letters may be used for the hexadecimal digits.
Syntax
property: <string>;
Values
- <string>Defines the characters used in the string.
Example
<div></div>
div::after {
content: "We all ♥ CSSPortal.com";
}
Browser Support
The following table will show you the current browser support for the CSS string
data type.
Desktop | |||||
12 | 1 | 1 | 3.5 | 1 |
Tablets / Mobile | |||||
18 | 4 | 10.1 | 1 | 1 | 37 |
Last updated by CSSPortal on: 7th October 2023