RGB Colors in CSS
RGB colors can be specified in style rules by any of the methods listed in Table D-2.
Table D-2. Methods for specifying RGB colors
Method |
Syntax |
Example |
---|---|---|
Six-digit hexadecimal. |
|
|
Three-digit RGB shorthand. This method may be used when each RGB value is double digits. |
(interpreted as # |
(interpreted as |
Three decimal values. |
|
|
Three percentage values (calculated as a percentage of 255). |
|
|
Get Web Design in a Nutshell, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.