data-type

<alpha-value> — CSS reference

Alpha expresses opacity of a color: zero is transparent and one or 100% is opaque. Values outside the normal range are clamped. Color alpha affects that paint, while the opacity property applies to an element as a composited group, including its descendants.

Formal Syntax & Structure

css syntaxcss
<alpha-value> = <number> | <percentage>

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS color lab</title><style>body {margin:0} .sample {height:12px;background:#006050}p {padding:12px;background:white;color:black;border:2px solid currentColor} #a{color:rgb(255 0 0 / 25%)} #b{color:rgb(255 0 0 / 200%)}
</style><body><p id="a">First color sample</p><p id="b">Second color sample</p></body></html>
CSS Reference