Wednesday, 9 November 2011

CSS Background

The background-color property specifies the background color of an element or page.

Example :

body {background-color:#000;} or body {background-color:black;}

Adding Background Image:-

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

Background Image - Repeat:-

By default, the background-image property repeats an image both horizontally and vertically.
Some images should be repeated only horizontally or vertically

Repeat horizontally (repeat-x):-

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

Repeat vertically (repeat-y):-

body{background-image:url('bg.png');background-repeat:repeat-y;}

No comments:

Post a Comment