BACKGROUNDS
Backgrounds are most commonly used in your HTML files to:
Place a graphic in the background of a page
in the background, use:
To see a full page with this background CLICK HERE,
Note the the background repeats horizontally and vertically. This is caused by the dimensions of the graphic being less then the width and height of the page displayed. If you don't want the background to tile then see Fixed Background
If you want the background to tile vertically but not horizontally, i.e. like a border on the left side, then make sure the graphic is wider than any possible resolution a visitor might use, e.g. 1200 or use the repeat-y below.
Use a small graphic as left border of a page.
This is a fairly simple task if you have a graphics editor like Paint Shop Pro or Irfanview. Here is how you would make the border.
CAUTION: Make sure that the resulting image "fits nicely" when it fills the page.
Here is example of what this will look like using this small image that is 103X108 pixels. I have put a border around the images so you can tell the size.
This 1024X108 pixel image is only 10K in size.
Fix a background on a page (works only in IE)
<BODY BACKGROUND="filename" BGPROPERTIES="fixed">
filename can be any graphic file, e.g. myphoto.jpg or thisphoto.gif.
You can also use CSS style in the <BODY> tag to accomplish the same thing, which I recommend that you use instead of the <BODY> tag above
<BODY STYLE="BACKGROUND-IMAGE:URL(filename); BACKGROUND-ATTACHMENT:FIXED"; BACKGROUND-REPEAT:NO-REPEAT>
If you wish the background to only tile, i.e. repeat, in either the X or Y direction (X is horizontally and Y is vertically) then use the BACKGROUND-REPEAT:REPEAT-X.
The second method for a background is to fill the background with a graphic. In the following example I have selected a graphic named cloudsky.jpg. To display the graphic
This is a simple code to fix the background on the page but it works only with Microsoft Internet Explorer (IE).
| WHY? FOR BACKGROUNDS |
|
Question: Why won't my background image display?
Answer:
|