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 ...

Get Cascading Style Sheets (CSS) by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.