CSS-Lesson 8

Backgrounds

Introduction

Background color has been discussed in CSS Lesson 4. However, many web sites use a background picture. This can be used once or may be repeated. It can be repeated either horizontally or vertically or it can be repeated all over. The background can be fixed with respect to the page content or to the window.

The properties that control the use of a background image are background-image, background-repeat, background-attachment, and background-position. These properties are associated with the following values.

Property Value Notes
background-image url(image url)  
background-repeat inherit
repeat*
repeat-x
repeat-y
no-repeat
repeat (all over) is the default value
background-attachment inherit
scroll*
fixed
The background either scrolls with the content or is fixed within the window
background-position top
right
bottom
left
center
(combination)
(percentage)
(length)
 

The Background property

The background property is a shorthand form for background-color, background-image, background-repeat, background-attachment and background-position.

Fonts and Text

The text content properties of a web page usually start with either 'text' or 'font'.

Font properties

The 'font' property is a shorthand version of the combination of:

Previous Lesson previous lesson next lesson Next Lesson