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

Chapter 12. Box Properties > border-color Property

12.3. border-color Property

The border-color property sets the color for the border to be displayed. Previous to the introduction of this property, the only way you could add color to borders was to use the bordercolor attribute, or the Internet Explorer-only bordercolorlight or bordercolordark in conjunction with the <table> HTML tag. The border-color property opens things up so that a Web author can add color to any block-level element.

The border-color property, like all other color CSS properties, allows Web authors to set a color value in a variety of ways. For example, it can take a standard color name (such as “red”) or a hexadecimal color value (such as “#FF0000”, which is also red), both of which are standard ways of setting color values in HTML. In CSS, you can also specify color using a “compressed” hexadecimal color value (such as “#0F0”, which is green). You can also use a three-digit 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. The CSS3 color module will probably introduce some new ways of setting color (and transparency) values — for more information on ways of specifying color, please see Chapter 13, “Color.” Listing 12.2, whose results can be seen in Figure 12-4, demonstrates the different ways of implementing color — save those of the yet to be implemented CSS3 color module — with the border-color property in a single Web page.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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