1. Home
  2. Computing & Technology
  3. Web Design / HTML

background-repeat

By , About.com Guide

background-repeat Description:

The background-repeat property defines the background image of the element.

background-repeat in CSS Versions:
background-repeat Syntax:

background-repeat: repeat | repeat-x | repeat-y | no-repeat | inherit

  • repeat
    The standard, repeat horizontally and vertically.
  • repeat-x
    Repeat horizontally only.
  • repeat-y
    Repeat vertially only.
  • no-repeat
    Do not repeat the image, display it only once.
  • inherit
    The element should have the same background-repeat setting as the parent.
background-repeat Initial Value:

repeat

background-repeat Applies To:

All elements.

background-repeat Inheritance:

This property is not inherited.

background-repeat Browser Support:
background-repeat Examples:

Repeat horizontally

<p style="background-repeat : repeat-x; background-image : /library/graphics/purple.gif;">
This paragraph has the purple.gif image as a background repeating horizontally.
</p>

Repeat once

<p style="background-repeat : no-repeat; background-image : /library/graphics/purple.gif;">
This paragraph has the purple.gif image as a background displaying only once.
</p>
background-repeat Special Notes:
  • The background-repeat property only reliably works in the <body> tag in many browsers.
  • This style requires a background image set.
More background-repeat Information:

Return to the Style Library

Explore Web Design / HTML
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. CSS
  5. Style Properties
  6. CSS Style Property: background-repeat>

©2009 About.com, a part of The New York Times Company.

All rights reserved.