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

Chapter 6. Working with Colors and Backg... > Setting Foreground and Background Co...

Setting Foreground and Background Colors

In previous chapters, you've already worked with several examples of using foreground and background colors. In this section, you'll be delving much deeper into the different ways in which you can set foreground and background colors in your pages.

NOTE

In HTML, you can set the foreground color for text using the FONT tag's COLOR attribute. You can use the BODY element's BACKGROUND, TEXT, LINK, VLINK, and ALINK attributes to set default background, text, and link colors for your page, as well as the BGCOLOR attribute to set background colors. All of these attributes have been deprecated in HTML 4 and XHTML 1, in favor of using styles instead.

In this chapter, you learn how to set foreground colors, background colors, and background images using styles, rather than using deprecated HTML elements and styles to achieve these effects. Later, in Chapter 8, “Working with Text and Links,” you learn how to control the colors of your hypertext links.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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