data-type
<hex-color> — CSS reference
Hex notation expresses sRGB channels as hexadecimal digits. Three- and four-digit forms duplicate each digit; the optional alpha channel is last, not first. Eight-digit syntax uses two digits for each channel including alpha. A leading # is required.
Formal Syntax & Structure
css syntaxcss
#RGB | #RGBA | #RRGGBB | #RRGGBBAAWorking 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:#f008} #b{color:#ff000088}
</style><body><p id="a">First color sample</p><p id="b">Second color sample</p></body></html>