• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 13. Color > color Property

13.1. color Property

The color CSS property simply sets the color to be displayed for an associated element. The color property works the same way as the color attribute does with the <body> tag or a number of other XHTML tags.

This property can take any color value type that can be associated with CSS. For example, it can take a standard color name (such as “blue”) or a hexadecimal color value (such as “#0000ff”, which is also blue), both of which should be familiar ways of setting color for people used to setting it in HTML. CSS allows you to set color values using four additional color formats: a compressed hexadecimal color value (such as “#00f”, which again equals blue), a numerical triplet RGB (Red Green Blue) color value where “rgb(0,0,255)” is blue, and a three-digit RGB percentage color value where “rgb(0%,0%,100%)” is blue. Table 13.1 neatly lays out the different ways you can specify color values numerically in CSS.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint