|
Setting your HTML background
Background is one of the most important elements of our web page. It is the background which can make the page look good or bad.
There are two types of backgrounds:
1. Plain Background:
To add a plain background to your page is easy. Simply, you have to add a bgcolor property to the body tag.
That would be:
<body bgcolor=“#FF0000”>
2. Image Background:
To specify a background image for an html page you need to use the background attribute. This attribute is equal to the url of the image.
Example:
<body background=“river.gif”> <body background=http://www.visualbuilder.com/river.gif>
Note: If your selected image is smaller than the browser window then it will keep repeating until the whole browser window is filled.
Your url can be either relative as shown in the first line or can absolute as in the second line.
However, while using an image as your background, you should consider the following points carefully:
- Whether the background image will coincide with the other elements (text, colors, and other images) of the page?
- Whether the background image will make the page heavier to load?
- Whether the repetition of the background image would look good on the page or not?
- Whether the background image carry off the viewers attention from the data given
Note: It should be remembered that the attributes in the body tag are not acceptable by the latest versions of HTML i.e. HTML 4 and XHTML).
Instead, it is recommended to use Style Sheets (CSS) to define the layout and HTML elements.
|