banner
Welcome to HTML.co.uk, the number one resource for all news, information, and happenings regarding HTML.

Updates: HTML.co.uk has just been relaunched. Subscribe to our RSS Feed to stay on top of HTML news and techniques.
May
12th

Embedding Wallpaper

Author: Editor | Files under Backgrounds, HTML Tutorials
Tags for this article: , , , ,

While displaying an HTML file you can set the wallpaper. The picture will then continuously be repeated throughout the display window, so that the wallpaper effect results. Relatively small graphics, that represent some abstract model, are especially well suited for wallpaper effects. We will offer some typical examples in a separate chapter regarding graphics.

The background graphic should be saved as a graphics file in either the GIF or JPEG format.

An Example:

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
“http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<title>Embedding Wallpaper</title>
</head>
<body background=”background.jpg” text=”#990000″ link=”#0000CC” vlink=”#000066″ alink=”#000000″>
<h1>Text</h1>
<a href=”http://www.yahoo.com/”><b>Link to Yahoo</b></a>
</body>
</html>

Explanation:

The elements for embedding wallpaper result from the HTML file’s introductory <body> tag. With the background attribute you define graphics files as background pictures. The entire HTML file will then be displayed on the background picture shown here.

Take Note:

The background attribute has been characterized as deprecated and should be avoided in the future. You can achieve the same effect using style sheets, like so:

<body style= “background-image:url(background.jpg)”>

When general rules for referencing in HTML apply when entering the URI for the wallpaper.

The background picture applies for the HTML file, in which it is defined. If you produce a document from multiple HTML files, that all need to have a unified background image, then you must repeat the element in every file.

With text oriented HTML files you should use more low-key backgrounds so that nothing interferes with the reading. Attention grabbing background images should only be used if the entire site is constructed graphically and the graphics in the foreground fit with the background graphics.

Web browsers also interpret animated GIF graphics as wallpaper.

Internet Explorer knows an additional attribute, bgproperties= “fixed”, in the introductory <body> tag, with which you can produce unmoving background images. However, this attribute has never belonged to the HTML standard and can also be replaced with a CSS element, for example: <body style= “background-image:url(background.jpg); background-attachment:fixed;”>


May
12th

Colours for the Background

Author: Editor | Files under Backgrounds, HTML Tutorials
Tags for this article: , , , ,

You can determine a colour for the display window’s background. The entire HTML file will then be shown on this background colour.

An Example:

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
“http://www.w3.org/TR/html14/loose.dtd”>
<html>
<head>
<title> File Wide Colour for the Background</title>
</head>
<body bgcolor= “#CCFFFF”>
<h1>text, links, graphic references etc. </h1>
</body>
</html>

Explanation

The elements for the background colour in the HTML file are carried out through the introductory <body> tag.

With text you define a colour for the text.
With link you define a colour for links to already visited sites that have not been visited yet.
With vlink you define a colour for links that have already been visited.
With alink you define a colour for links that have just been activated.

Take Note:

All of these attributes have been classified as deprecated and should be avoided in the future. You will achieve the same effect with the help of style sheets, placed in the file header in between <head> and </head> using the following source text, for example:
<style type=“text/css”>
body { background-color:#663333; color:#FFCC99; }
a:link { color:#FF9966; }
a:visited { color:#FF9900; }
a:active { color:#FFFFFF; }
</style>

The defined text foreground colours should contrast with the background colours. If, for example, you define a dark background colour, then you should choose a bright foreground text (such as white, yellow, light green and light blue).

Additional Possibilities

When using style sheets you must then know how to define CSS formats. Then you will be able to use CSS attributes which we will describe in depth in later sections.