Wednesday, 20 January 2016

Background Properties

The background-color Property:
body {background-color:#cccccc; color:#000000;}
p {background-color:#FF0000; color:#FFFFFF;}
The background-image Property:
body {
background-image: url(“images/background.gif”);

background-color: #cccccc;}
The background-repeat Property:
¢If you do not want your image to repeat all over the background of the page, you should use the background-repeat property.
body {
background-image: url(“images/background_small.gif”);
background-repeat: repeat-x;
background-color: #ffffff;}
The background-position Property(for fixing position of backgrounds)
¢You may want to alter the position of this image, and you can do so using the background-position property
Background-position Example
body {
background-image: url(“images/background.gif”);
background-position: 50% 20%;
background-repeat: no-repeat;
background-color: #eaeaea; }

The background-attachment Property
The background-attachment property allows you to specify an image known as a watermark.
body {
background-image: url(“images/background.gif”);
background-attachment: scroll;
background-position: center;
background-repeat: no-repeat;}

0 comments:

Post a Comment