The first order of business is to select the type of background we want to use. Types that are appropriate are scenes such as clouds, sky, oceans, stars etc. or textured backgrounds. The background image
width should be your screen width and the
height should be about your screen height to achieve the best effect. The screen dimensions used for this page are
width=1366px and
height=1310px.
Now the chosen background has to be re-sized to double the screen width and to height of your web page.
Here is a simple way to achieve this
- create a new div, say bg with these parameters
#bg{position:absolute;left:-1366px;top:0px;z-index:-1;}
The index is set at -1 so the new bg div does not overwrite the page contents
- now create the div holding a table with the bg dimensions
<table background="b/75.jpg" width=2732 height=1310><tr><td> </td></tr></table>
- the completed div will look like this
<div id=bg
<table background="b/75.jpg" width=2732 height=1310><tr><td> </td></tr></table> </div>
|
Now lets assemble the three components necessary to construct the web page.
- Script is the engine that moves the background
- Style is where elements are named and attributes are defined and positioned
- Body is where the page text and images are defined. The moving background is located here.
|
|
The follow should be taken into consideration when using moving backgrounds
- overflow-x:hidden; is required as the background image is twice the screen width.
- The bottom cover will cover the moving background. Artistic considerations will determine its vertical location
- The z-index must be taken into consideration when using images as an image is being used as a pseudo background
- The height of the image used as the moving background will determine the depth of moving background
|