O'Reilly logo

Real World XML by Steven Holzner

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 Colors and Backgrounds

These are the properties you use to set color and backgrounds:

  • color— Sets the foreground (text) color.

  • background-color— Sets the background color.

  • background-image— Sets the background image.

  • background-repeat— Specifies whether the background image should be tiled. You can set this to repeat, repeat-x, repeat-y, or no-repeat.

  • background-attachment— Specifies whether the background scrolls with the rest of the document.

  • background-position— Sets the initial position of the background.

You also can use a background shorthand property to set the background color, image, repeat, attachment, and position all at once (list those values in order). I'll cover how to use this shorthand property at the end of the chapter.

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