O'Reilly logo

Cascading Style Sheets (CSS) by Example by Steve Callihan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required