Inline Styles Properties and Values
CSS Values: Colours
CSS allows to specify colours in a number of different ways, including:
•
Via colour keywords:
CSS has about 140 names for a wide range of colours, for example:
red, green, blue, gold, peachpuff, snow, rebeccapurple
•
Via hexadecimal notation: #RRGGBB
defines a colour as a mix of the colours red, green and blue
R (red), G (green), B (blue) are hexadecimal characters (0-9, A-F)
representing three numbers between 0 and 255, which in turn, specify
the intensity of that colour
Example: #FF000 defines the color red
•
Via functional notation: rgb(R,G,B)
defines a colour as a mix of the colours red, green and blue
R (red), G (green), B (blue) are either decimal numbers between 0 and
255 or percentages 0% to 100% that again specify the intensity of that
colour
COMP519 Web Programming Lecture 5 Slide L5 – 12