Background Effects


Simple backgrounds

If you do not specify any background for your webpage, the default text colour will be black and the default background white. This can look quite impressive with a Times New Roman or Arial (San Serif) font in black for technical pages such as this, however it is nice to have a coloured background or alternatively use a image "tiled" as the background.

Coloured backgrounds

When using a WYSIWYG editor such as Netscape Composer, right click anywhere on the page and select "Page Properties" Change the fifth (background colour) to your desired colour by clicking on the white panel and selecting a colour from the drop-down dialogue.
If you choose a light colour you may wish to retain the black text.
If you choose a very dark colour you will probably find you will also wish to change the text colour to a pale colour.

Here are two examples:

Light background, dark text

Dark background, light text.
 

Using an image as a background

Follow the procedure as for customising the colour of the page, but insert a select an image file name, where it says "Background image" ensure the image is in the same folder as the webpage you are creating and check
use image. There are similar requirements to have sufficient contrast between the text colour and the background colour of the image.

Here are two examples:

Light background image, dark text

Dark background image, light text.
 

Pictures can also be used as background images and the image will be tiled, bear in mind, the larger the image used as the background, the larger the file size and hence the slower the page will load.
 

Example of a large picture background
 

Fixed backgrounds

The code that is used for setting an image to use as a background image is:

<body background="image_name.jpg">

This is placed just after the closing head tag </head> ie in the body section.

If you use a WYSIWYG editor you will not normally need to bother with the code for basic pages, but for some of the special effects you will need to amend the code manually using notepad text editor.

To scroll the text by hand over a fixed background you need to amend the code to:

<body background="image_name.jpg" bgProperties="fixed"

Open the webpage in notepad
Find the portion that begins <body background....
Add the portion in red text
Save
Open the file in Internet Explorer and see the effect. Note this effect does not work with Netscape Navigator

Example of a fixed background
 

Backgrounds that scroll

This is an effect that makes use of a javascript.

Below are the instructions to copy and paste HTML link code into your webpage using Windows Notepad or similar HTML webpage editor:

Select the HTML code below (by "right clicking" with your mouse cursor inside the below code box window, then choose "select all" from the options). Then right click again on the highlighted text with your mouse cursor and choose "copy" from the options.

Then, open your desired webpage in Windows Notepad.
Move mouse pointer to location you require the code to be inserted on your page (the code should be pasted into the "body" section of your page), and left click there once to leave the flashing cursor.
Then right click and choose "paste" from the options.

Note:
You can increase the scrolling effect speed of the background image on the page by changing the
nIncrement = -1 part of the code to a number of say -6 ( i.e....nIncrement = -6).

Example of a page using this javascript.
(Note that at the present time only the newer versions of Internet Explorer Browser can read this effect.)
 
 

Michael Fowler,  January 2001
 

Return to Home page