Pages

Friday, March 15, 2013

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:

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

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

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

0 comments:

Post a Comment