lecture menu |
lecture 5: backgroundsImages can also be used as backgrounds, as you can see here. This is done with style sheet properties and can be done for either the whole page or for individual page elements such as paragraphs or table cells. If done for the whole page, the style information goes with the <body> tag. The <body> for this page looks like this:
<body style="background-image: url(badgeback.gif);
background-repeat: no-repeat;
background-attachment: fixed;
background-position: 50% 20%;">
background-image points to the image file, as should be obvious. What the other three properties do is less obvious. There is more information on the page on background images in the online teaching materials. Realise though that without these other properties the whole background of this page would be covered in "tiled" versions of this image (and you can see an example of this on that page). Not all images make good backgrounds - in fact comparatively few do. Which of the following do you think will make good backgrounds, and which bad?
Please remember the following guidelines:
Having said all that they can be effective if used well, and this particularly applies if they are restricted to small parts of the page, e.g. individual paragraphs or table cells. You can also get some good creative effects with them. The "vertical rules" which appear on most pages of this site are done with a background, set up to repeat only vertically (via the background-repeat property). The answer to the question posed above, by the way, was that numbers 3 and 5 would make for good backgrounds, at least for a whole page. The others would be bad for one or more reasons. Examples of most of these in place can be found on the relevant page in the online teaching materials. |