Pages

Friday, March 15, 2013

Background Image - Set position and no-repeat

Remark When using a background image, use an image that does not disturb the text.
Showing the image only once is specified by the background-repeat property:

body
{
background-image:url('img_tree.png');
background-repeat:no-repeat;
}



In the example above, the background image is shown in the same place as the text. We want to change the position of the image, so that it does not disturb the text too much.
The position of the image is specified by the background-position property:

body
{
background-image:url('img_tree.png');
background-repeat:no-repeat;
background-position:right top;
}


0 comments:

Post a Comment