|
|
|||||||||||
Using Background Images on Web Pages, and Resources
How To Create ThemBackground images can be GIF or JPEG; PNG and other formats may (soon) be options in some browsers. You can get ready-made background images from many sources - see end of this page for a list. Even better, create your own with a graphics program. Keep the file size small; a few Kbytes should be enough. Any larger and there is probably too much detail in your image for the text to be readable. Usually you want the image to tile seamlessly - i.e. the join between tiles should not be discernable. Some graphics programs can make seamless tiles.To create a left-border effect, create a graphic about sixteen hundred pixels wide and only a few pixels tall. If the browser display window were somehow widened past sixteen hundred pixels, the background image would tile horizontally as well, but not too many users will stretch their windows that far (and most monitors are not that wide). How To Use ThemThe BODY tag has a BACKGROUND attribute to specify the URL of an image that is to be used as a background for the document.<BODY Background = "/Authoring/Graphics/Images/bluesq.gif" Bgcolor = "#000000" Text = "#ffcc66" Link = "#ffff99" Vlink = "#ffcc33" Alink = "#ff0000" >The attribute's value is the URL of the graphic that will be tiled as the background of the page. The user will not see this background in non-compliant browsers, if image loading is turned off, or if the user has overridden the background images in their preferences. If a background file specified in the Background attribute cannot be found, the color specified by the BGCOLOR tag will be used. The BGCOLOR will also be used if the user has auto load images off. The background image will be tiled in the browser's document viewing area. Design IssuesA couple of problems to watch out for: make sure the background image and text and link colors contrast well. There are many pages on the web that are unreadable because the text or links are swallowed up by the background color. They probably looked fine to the page designer on their own screen, but unfortunately screens - and other people's eyes - vary considerably.Take care about the amount of detail in the image. Too much - in fact, almost any - can reduce readability. If it does, you might find it better to place a plain color behind the text, e.g. by enclosure in a table cell, or by using style sheets. When specifying a background image it is a good idea also to specify a background color. That color should be one similar to the prevailing color of the image; this ensures that if the user viewing your page has image loading off, or if your background image cannot be loaded for some reason, the page will still look close to the way you intended. If the image you specify as a background has transparent areas, the BGCOLOR will show through (beware, this can show up as black on Macs). The attribute sets the color of the background as "#rrggbb" where "#rrggbb" is a hexadecimal red-green-blue triplet. Take care to select a default color similar to the background image's predominant color, and to explicitly set the foreground and link colors to contrast adequately for readability. An extremely common error is to assume that everyone's default text color is black... As you should already be aware, it is bad practice to load a background or any other image to your page, from another person's web site, without their prior agreement. And be aware that if you do, your page will suffer the consequences if their server goes down or if they move the images. Further Resources
See also:-
| ||||||||||||
Up to =>
Home
/ Authoring / Graphics / Techniques
internet.com
| |
e-commerce
| |
WebDeveloper Network
|
Copyright 1999 internet.com, LLC. Legal Notices. Privacy Policy.