Presentation is loading. Please wait.

Presentation is loading. Please wait.

Colors. Color of HTML Elements You can control the color of the following elements: You can control the color of the following elements: All text within.

Similar presentations


Presentation on theme: "Colors. Color of HTML Elements You can control the color of the following elements: You can control the color of the following elements: All text within."— Presentation transcript:

1 Colors

2 Color of HTML Elements You can control the color of the following elements: You can control the color of the following elements: All text within the body of a page All text within the body of a page Background of a page Background of a page Background of a table Background of a table Each row of a table Each row of a table Each cell of a table Each cell of a table

3 Examples To set To set Page background color to black and Page background color to black and text color to white. text color to white. To set To set Particular text to blue Particular text to blue This part of the sentence is shown in red, while the rest is in the default color.

4 How To Specify Color Color may be specified Color may be specified in English notation with predefined color names (for 16 colors), or in English notation with predefined color names (for 16 colors), orpredefined color namespredefined color names in a format known as the Hexadecimal notation in a format known as the Hexadecimal notation

5 Specifying Colors in Hex Notation Using hexadecimal notation, it is possible to specify over 2 million shades Using hexadecimal notation, it is possible to specify over 2 million shades #FF0000--red #FF0000--red #00FF00--green #00FF00--green #0000FF--blue #0000FF--blue #FFFF00—yellow #FFFF00—yellow Other examples Other examples Other examples Other examples To set some text to “brown” color: To set some text to “brown” color: some text some text

6 Decimal Notation In Decimal System In Decimal System Ten symbols are usedto express any number -- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Ten symbols are usedto express any number -- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Each position implies a power of 10 Each position implies a power of 10 E.g. (Decimal) number 3234 means (3 x 10 3 ) + (2 x 10 2 ) + (3 x 10 1 ) + (4 x 10 0 ) = 3000 + 200 + 30 + 4 = 3234 E.g. (Decimal) number 3234 means (3 x 10 3 ) + (2 x 10 2 ) + (3 x 10 1 ) + (4 x 10 0 ) = 3000 + 200 + 30 + 4 = 3234

7 Hexadecimal Notation In Hexadecimal System In Hexadecimal System 16 symbols are used--0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. 16 symbols are used--0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. Each position implies a power of 16 Each position implies a power of 16 E.g., (Hexadecimal) number 5F means (5 x 16 1 ) + (15 x 16 0 ) = (5 x 16) + (15 x 1) = 80 + 15 = 95 (decimal) E.g., (Hexadecimal) number 5F means (5 x 16 1 ) + (15 x 16 0 ) = (5 x 16) + (15 x 1) = 80 + 15 = 95 (decimal)

8 RGB Values #rrggbb-- e.g., #FFFF00 #rrggbb-- e.g., #FFFF00 rr -- These 2 digits indicate intensity of red rr -- These 2 digits indicate intensity of red gg --These 2 digits indicate intensity of green gg --These 2 digits indicate intensity of green bb -- These 2 digits indicate intensity of blue bb -- These 2 digits indicate intensity of blue For example, For example, #FF0000--red #FF0000--red #00FF00--green #00FF00--green #0000FF--blue #0000FF--blue #FFFF00—yellow #FFFF00—yellow Other examples Other examples Other examples Other examples

9 Your Turn Given a hex number: A5 Given a hex number: A5 What is its decimal equivalence? What is its decimal equivalence? Given a hex number: 120 Given a hex number: 120 What is its decimal equivalence? What is its decimal equivalence? Given a decimal number: 21 Given a decimal number: 21 What is its decimal equivalence? What is its decimal equivalence? Given a decimal number: 256 Given a decimal number: 256 What is its decimal equivalence? What is its decimal equivalence?


Download ppt "Colors. Color of HTML Elements You can control the color of the following elements: You can control the color of the following elements: All text within."

Similar presentations


Ads by Google