Prev | Current Page 73 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"

A value with
three digits represents the corresponding six-digit value where each digit occurs
twice; thus #09f is the same as #0099ff (red=00, green=99, blue=ff).
Decimal Notation
We can also write a color value with decimal functional notation??”rgb(0, 160,
255) or rgb(0%, 63%, 100%)??”where the order of the arguments is red, green, and
blue. Using the first form, 255 corresponds to 100%. Values outside the valid range
(0??“255 or 0%??“100%) are automatically changed to the corresponding limit.
CSS3 makes a few extra functional notations available:
?–  rgba(0, 160, 255, 0.2) for RGBA colors; the fourth argument is the alpha
opacity and accepts a value from 0 to 1
?–  hsl(240, 100%, 50%) for HSL colors (hue, saturation, luminosity)
?–  hsla(240, 100%, 50%, 0.2) for HSLA colors (hue, saturation, luminosity,
alpha)
General Syntax and
Nomenclature
The Ultimate CSS Reference 34
At the time of writing, these three notations were supported only by the Gecko8 and
WebKit9 rendering engines.


Pages:
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85