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). |
|
|