Connecting Tech Pros Worldwide Help | Site Map

Color and Background

By Mark Hardy
Administrator, TheScripts.com

Color and Background Properties

color
This element will set the colour of any given tag. e.g. - for text it will define the text color, for form elements it will set the foreground color. You can use proper names for colors (e.g. red) or hex codes (e.g. FFFFFF - for white).

a {color: FFFFFF;)

background-color
This will set the color of the background of any given element. This, also, can be defined using proper names, or hex codes.

a {background-color: 000000;}

background-image
This allows you to set an image to be the background image.

BODY {background-image: url(background.jpg);}

background-repeat
Allows you to change the way in which the background is tiled.

BODY {background-repeat: no-repeat;}

background-attachment
Allows you to define whether or not the element scrolls with the background image.

BODY {background-attachment: no-scroll;)

background-position
Allows you to set the starting position of the background.

BODY {background-position: middle right;}

background
Allows you to set all the previously mentioned background properties much quicker. However, unlike the font function, you do not have to specify everything in a given order.

BODY {background: black no-repeat no-scroll middle right;}

« CSS Parameters Text Properties »