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

Displaying Images

You can use several properties with images:

  • background-image— Sets a background image. Set this to a URL.

  • 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. Specify an x and y coordinate here (where the origin is at the upper left), such as background-position: 0% 100% to add a background image to the lower left.

There's also a background shorthand property that you can set to the background color, image, repeat, attachment, and position all at once (list those values in order).

Here's ...

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