Thursday, July 8, 2010

Background Image - Repeat Horizontally or Vertically

By default, the background-image property repeats an image both horizontally and vertically.

Some images should be repeated only horizontally or vertically, or they will look strange, like this:

Example
body
{
background-image:url('gradient2.png');
}


If the image is repeated only horizontally (repeat-x), the background will look better:

Example
body
{
background-image:url('gradient2.png');
background-repeat:repeat-x;
}


Source: http://www.w3schools.com/css/css_background.asp

No comments:

Post a Comment