background-color: color \0;
hackLast updated 2016-01-28.
.your-selector-here { background-color: somecolor \0; }
…where somecolor
is a CSS color value.
Source: Browser CSS Hacks by Paul Irish
Important note!
This article only applies to the background-color
property and only applies when there is space between somecolor
and \0
.
Adding spaces or using different properties may change the compatibility of the hack.
You have been warned.
If the rectangle above is light green, then your browser supports this hack for color keyword values (e.g. lime
).
If the rectangle above is light green, then your browser supports this hack for RGB colors in hexadecimal notation (e.g. #adff2f
).
If the rectangle above shows the word "Affected" on a green background, then your browser supports this hack for the transparent
keyword color value.
If the rectangle above is light green, then your browser supports this hack for RGB colors in functional notation (e.g. rgb(173, 255, 47)
).
Check out the links for corroborating screenshots.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|---|
Chrome | OS X Safari |
iOS Safari |
Firefox | MS Edge1 | Internet Explorer |
49
Unknown |
10
Unknown |
9.3
Unknown |
45
Unknown |
13
Unknown |
|
48
Unknown |
9.0.3
Unknown |
9.2
Unknown |
44.0
Unknown |
12.10240
Unaffected |
11
Unaffected |
47
Unknown |
8.0.8
Unknown |
8.4
Unknown |
43.0.1
Unknown |
12.10166
Unknown |
10
Unaffected |
26
Unaffected |
7.1.7
Unaffected |
7.1
Unaffected |
4.0.1
Unaffected |
9
Unaffected |
|
25
Unknown |
6.2.7
Unknown |
6.1
Unknown |
8
Unaffected |
||
7
Unknown |