Colors

Specifying colors in CSS is done for customizing the text color, border color, or background color and it can be done by many formats. Colors in a web page uses range of colors or palette which also vary from a 216-color, Web-safe palette to the full range of colors available in the RGB format of 16,777,216 colors. More specifically, those options are as follows:
RGB values: These enable you to specify a color via a Red, Green, Blue representation, which provides access to millions of colors.
RGB percentage: This option is the same as RGB but uses percentages.
RGBA (RGB with alpha channel): The RGB palette is used with the addition of an alpha channel to specify transparency.
Each method is a means of accomplishing the same thing: specifying a color. You can use these methods to specify text color, border color, or background color. Next, you see what each of these methods looks like when used in the context of a style sheet rule.
Color Keywords
It is the easiest method as the name of the color is used like red, black, blue, etc. There are a small number of keywords present compared to millions with other color value types. It is used as
color: black;
background-color: red;
border: thin solid orange;
Hexadecimal Colors
It uses hexadecimal number system which uses 16 characters as its base and a combination of letters (A-F ) and numbers (0-9). Hexadecimal values are used to express an RGB value like #FFFFFF refers to white, which in RGB is 255, 255, and 255. It is limited to a 216-color, Web-safe palette. It is used as
color: #000000;
background-color: #FF0000; border: thin solid #FFA500;
Short Hexadecimal – If a hexadecimal value has pairs of duplicated values then a shorthand for them can be used by using only a single value for each pair like for #FFFFFF the shorthand is #FFF. It is used as
background-color: #FFF;
RGB Colors
It refer to primary colors (red, green, and blue) used to display the color of pixels in various combinations to create different colors. It uses a three-number values (0 to 255), with first number for red, second for green and third for blue as
background-color: rgb(128, 128, 128);
Various color codes are explained in the figure
VS-1056 Certified CSS3 Designer Reading_Material_html_m4f80dc9d
Share this post
[social_warfare]
Numbers
URL()

Get industry recognized certification – Contact us

keyboard_arrow_up