Available in Chrome 52+ | View on GitHub | Browse Samples
Starting with Chrome 52, hex color values can include an alpha (transparency) value. This capability has two forms.
Consider the example code below. Both
<div> elements have a red background overlaid with yellow box.
.overlay1 shows what all the examples would look like without an alpha channel. Yellow overlays red.
.overlay2 shows the new syntax using two-character hex values. (The value
#ff07 would accomplish the same thing.)
To approximate the alpha channel results in older browsers, the example uses
@supports not to set a color that approximates the result of placing yellow over red with a 50% transparency.