Background Controls

Each object on your web page has a background. The background is either transparent so that the background of the parent object shows or it can be defined specifically for the current object using these stylesheet attributes:

Alternatively all of the above can be included into one background attribute by specifying them in the order colour, image, repeat, attachment, position with each separated by spaces from the others. Not all attributes need be included.

Length can be specified in a number of different ways:


.head {background-color:#fff;}
.body {background-image:url(mypic.gif); background-attachment:fixed;background-repeat:no-repeat;background-position: center center;}
.foot {background: #ffffff url(mypic.jpg) repeat-x center left;}


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow