CSS <string> Data Type


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.
For a complete list of Unicode characters, please visit Character Codes website.


property: <string>;


  • <string>Defines the characters used in the string.


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.

Edge Chrome Firefox Opera Safari
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview

Last updated by CSSPortal on: 7th October 2023