1 / 9

Colors

Colors. Color of HTML Elements. You can control the color of the following elements: All text within the body of a page Background of a page Background of a table Each row of a table Each cell of a table. Examples. To set Page background color to black and

julian-snow
Télécharger la présentation

Colors

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Colors

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

  3. Examples • To set • Page background color to black and • text color to white. <body bgcolor=“white” text=“black"> • To set • Particular text to blue <font color=“red">This part of the sentence is shown in red</font>, while the rest is in the default color.

  4. How To Specify Color • Color may be specified • in English notation with predefined color names(for 16 colors), or • 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 • #FF0000--red • #00FF00--green • #0000FF--blue • #FFFF00—yellow • Other examples • To set some text to “brown” color: <font color=“#FF8429”>some text</font>

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

  7. Hexadecimal Notation • In Hexadecimal System • 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 • E.g.,(Hexadecimal) number 5F means(5 x 161) + (15 x 160)= (5 x 16) + (15 x 1)= 80 + 15 = 95 (decimal)

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

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

More Related